Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3489418
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:23:36+00:00 2026-05-18T11:23:36+00:00

I have a DLL which is written in native C++. The Visual Studio project

  • 0

I have a DLL which is written in native C++. The Visual Studio project name is MyDll and it compiles to a file called MyDll.dll in the output directory.

After compilation, I rename it to MyDll2.dll. (This example seems silly but I have a good reason for renaming it.)

A second project, written in C++/CLI, uses this DLL.

At compile time, this project references MyDll.lib (generated when MyDll is compiled) to be able to use classes defined in the dll.

At runtime, to load the DLL, I call LoadLibrary, passing it the full path of the file C:\...\MyDll2.dll (it’s actually in the same folder). It loads successfully, as shown by LoadLibrary’s return value.

At the first occurence in code where I use a class defined in the DLL (just declaring an object on the stack), it crashes with an SEHException (these exceptions give no information whatsoever about the cause of the crash…)

This only happens if I do the renaming step. If I leave it as MyDll.dll and call LoadLibrary on that file, everything works fine. So it is obviously due to the renaming.

Any ideas why? Am I not allowed to rename the DLL?

(EDIT: clarifying by giving more details)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:23:36+00:00Added an answer on May 18, 2026 at 11:23 am

    When building a dll the linker also generates a lib-file which you use to link with in your executable. This lib file contains the dll-name from which the exported functions and data are being imported. So your executable has references to originally name dll in it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a native VC++ project that uses a dll (which is not in
I have a DLL written in C# which is acessed by a native EXE
We have a project with many dll files which get loaded when the application
I have two projects, the DLL project which has all my logic and data
I have a Nant build file which executes NUnit after compiling the dll's. I
I need some help regarding Visual Studio solution and project organization. I have a
I have a dll which comes from a third party, which was written in
We have inherited VB6 dll which we need to make changes to. We have
I have a .NET dll which needs to read it's config settings from it's
I have created a .NET DLL which makes some methods COM visible. One method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.