Exporting Data
-
Hey guys I have been desperately trying to export data (just varibles) from an executable and load them into a DLL but i can't get it to work so far i have tried extern and __declspec(dllexport) and dllimport. But i have had no luck any ideas on how i do this. Peter
-
Hey guys I have been desperately trying to export data (just varibles) from an executable and load them into a DLL but i can't get it to work so far i have tried extern and __declspec(dllexport) and dllimport. But i have had no luck any ideas on how i do this. Peter
You can't do that. You can only export objects from a DLL to an executable or another dll.
-
You can't do that. You can only export objects from a DLL to an executable or another dll.
Yeah but i really really need to do it is there no way to work around it
-
Yeah but i really really need to do it is there no way to work around it
Create the exported object in the dll, then in the application change its value. There is NO other way to do it. The reason should be obvious -- if the application were allowed to export and object, then the application would always have to be running whenever the dll is running. Lets say you have A.exe that export and object which X.dll uses. B.exe also uses X.dll but has no need for the object. When B.exe runs, X.dll is brought into memory, and because the dll references the object that was exported by A.exe, A.exe must also be executed. One of the purposes of a dll is to share its data and functions among many different applications. It would be terribly inefficnent to do it the other way around.