Original Post
Hello everybody, i have a little question with DLL and plugin system.
I have a DLL which is going to be a plugin of my application (if you somebody can help... ) this DLL contain init function:
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
and after some code that use function and object of my application (the .exe). But it can''t works because these function are undefined when linking the DLL. What trick can i use so that DLL should be able to use function of the .EXE ?
I have some idea:
1) change the .exe in a .lib and link it with the dll (and create another .exe with just few code that call function of the .lib). But it makes a lot of duplicate code. (the .lib is in the .exe and in all the .lib).
2) not using a .lib but another .dll which contain the application, but if my application wants to load the plugin, the plugin is going to load the other .dll which contain the application ? or is there some kind of protection in the loading of dll that disallow people to load more than one time a same dll ?
3) use some sort of _dllspec (dllimport) but i am not used with these.
I would be very happy if somebody could help me because i am feeling lost.
PS: excuse for my english it is not my natural language.