I'm having a problem getting a variable out of the DirectInput library.
This is for a 32 bit build (but that shouldn't be affecting this.) The goal is to be able to load the dinput8.dll on demand.
The dinput.dll is loaded on demand via LoadLibrary
| HINSTANCE hinst = ::LoadLibrary("dinput8.dll");
|
The pointer to the DirectInput8Create function is obtained via ::GetProcAddress
| FARPROC InputCreate = ::GetProcAddress("DirectInput8Create");
|
When I get to the point of creating a joystick device I want to use the predefined library variable "c_dfDIJoystick2." I should be able to get a pointer to it with GetProcAddress
| const DIDATAFORMAT * pc_dfDIJoystick2 = (const DIDATAFORMAT *)::GetProcAddress("_c_dfDIJoystick2");
|
The variable name string is taken from the Map file. AFAIK, the underscore prefix is the standard C prefix for symbol names.
However, the pointer is always null and the last error is
| 126: The specified module could not be found.
|
I would really prefer not to have to copy out the DIDATAFORMAT and all the DIOBJECTDATAFORMAT objects.
The only things I can think of are that the variable is in a DLL other than dinput8.dll or it is defined in the import library.
Looking for a hint.
- tim