I need to write a DLL (with MSVS 2010 PS1) that calls a function exported from exe:
(dll.h): extern "C" __declspec(dllimport) void* __stdcall SomeFunction();
The problem is that void pointer can point to any datatype, and exe developers do not provide any guidelines on how to use this function. Luckily exe project is opensource and I can see that SomeFunction actually returns a pointer to a structure, which is declared in structures.h file, which is used to compile exe:
struct exeStructure {int useme; int usecallback; <...> };
- How do I use this information to set usecallback variable from DLL? Could you please give an example?
- How should I dereference void* SomeFunction into exeStructure?
- Do I need to copy and include structures.h file in my DLL project?