Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
I'm developing a plugin for some third party software... which is necessarily in the form of an extension DLL.

Now I will want different language versions of my plugin so I initially thought to put my resources in a resource-only DLL, loaded by the plugin DLL. This is OK except I then need to keep manually swapping my resource handle which is a big pain.

So I then thought - can I make my resource DLL an extension DLL? But I'm not sure this will work - if I load the resource-extension DLL from my plugin (i.e., load an extension DLL from within an extension DLL) will my resources be in the chain correctly?

Or is this just a stupid idea? We could always just stick the resources in the plugin and have several languages versions...
Posted

It's not clear what exactly do you mean by "extension DLL" (plug-in DLL?), but this is not a stupid idea. But one pretty silly idea is making a problem out of it. You can load any reasonable number of DLL into the same host process; and it does not really matter if some DLL are loaded no directly, but through other DLLs. It could be some resource-only DLL, not a very rare practice.

The other thing is important, the plug-in or extension mechanism itself. If this is just statically linked DLL, it's not a problem at all. But essential plug-in or extension mechanism works in a way agnostic to the host application. The DLLs are loaded during runtime, and the detail of this DLL is not known during compile time. There should be the mechanism where the host and the plug-in pass some interface to each other and call functions through them. (In special cases, it can be one way only: the host can call the DLL's functions; but the other way also happens in general case.) Such plug-ins or extension architectures can be good or bad (some are amazingly bad, by the way). But you did not share any information, so I cannot advise anything certain. The "secondary" DLL can be just the implementation detail of the "primary" DLL, so, for the host application, it does not matter anything special. The length of such chain could be more then three steps you are concerned with. It's just should better be something reasonable, not pathological.

—SA
 
Share this answer
 
if you're running under MFC (as the tag suggests) use AfxSetResourceHandle

in your DLLmain, work out what language you want, load that resource only dll, and use the above call to point your MFC resource loader at it
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900