Jump to content
  • Advertisement
Sign in to follow this  
jwezorek

implicitly linking a DLL under an alias?

This topic is 2148 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on an application that is going to need to use a newer version of a DLL it uses and retain use of the old the version. Currently it implicitly links to the old version of the DLL and to make matters worse ... The DLL exports a class with non-virtual member functions so I don't think I can load it explicitly.

Is it possible somehow to get it to implicitly link to the new version too but under an alias? Meaning having say two versions of the header file and have them each map to seperate versions of the DLL even though the names of the exported class will be the same in the DLLs.

Or can I explicitly load a DLL that exports a class? Edited by jwezorek

Share this post


Link to post
Share on other sites
Advertisement
You can do explicit loading; just have the host app and the DLL agree on the interface you're sharing, and provide a function in the DLL's export table that gets access to an object that implements that interface.

Whether or not that actually works nicely in your situation is debatable :-)

Share this post


Link to post
Share on other sites
The problem is the old version of the DLL exists and is in the wild and it does what it does. I'm working on a new version of one of our applications that has to use the old DLL and a new version of the same DLL and am trying to figure out some way to do this cleanly.

I can't change the old DLL. I maybe can change the new DLL but I'll have to talk to the guy that wrote it, etc., and was hoping there was some way to not touch that code. But I guess it can't be done barring maiking my own wrapper DLL or explicitly linking and doing a weird hack to deal the fact that it is exporting a class. Edited by jwezorek

Share this post


Link to post
Share on other sites
Yeah, if you're limited in making code changes on the DLL side, you're kind of stuck. A shim is probably your best bet.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!