I created a small DLL and I want it to have an identifier of sorts, so I tried placing this in the DLL:
Code:
#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) const char* NAME = "SomeName";
#ifdef __cplusplus
}
#endif
And then used GetProcAddress to get the address of this variable:
Code:
//...after loading the DLL
name = (char*)GetProcAddress(hDll,"NAME");
GetProcAddress doesnt fail; however, name just contains garbage.
Defining functions in the DLL works fine, ie:
Code:
extern "C" __declspec(dllexport) void SomeFunc() { /*...*/ }
Any suggestions