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

  • Home
  • SEARCH
  • 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've written a multi-project .vstemplate file, which works alright, except that the projects have
Q: I have a dll which used in many systems, when i make any
I have an MVC3 application which has a reference to DLL. This DLL is
My company provides a third party with a DLL which provides them with API
I have two different files, Foo1.exe and Foo2.dll. When I try to use an
I was wondering if the two following scenarios have the same performance impact on
I have a C header to a certain library I need to access. So
We are receiving a problem whereby every time we copy a dll to the
I'm wanting to include a system tray icon in my WPF project, and found
I have a Main WPF application and other modules and I am using PRISM

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.