I’m trying to load fmodex.dll dynamically with LoadLibrary and GetProcAddress. Everything is fine with "FMOD_System_Create", but with "FMOD_System_GetVersion" ERRCHECK says at run-time: "An invalid parameter was passed to this function.".
[code:7nnqx8yc]typedef FMOD_RESULT (_stdcall *function2)(unsigned int*);
unsigned int fmod_version;
f2 = (function2) GetProcAddress(hFmod, "FMOD_System_GetVersion");
if (f2 == NULL)
fmod_result = f2(&fmod_version);
What’s the problem with my code (fragment)?
P.S. I want do design my software in such way that the audio capabilities are turned off if the file "fmodex.dll" is not found – that’s why I want to load it dynamically.
Is there a simpler way of doing this instead with LoadLibrary/GetProcAddress? Thank you. 😉
- fmod_steven asked 10 years ago
FMOD_System_GetVersion API takes two parameters:
FMOD_RESULT F_API FMOD_System_GetVersion (FMOD_SYSTEM *system, unsigned int *version);
GetProcAddress is the only way to use fmodex if present but still get your application to startup if the dll is missing. Or write a layer which will load / use fmodex/functions on demand, like some system dlls do (got some flat assembler source doing this)
Please login first to submit.