0
0

Hi,

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*);

function2 f2;

unsigned int fmod_version;

f2 = (function2) GetProcAddress(hFmod, "FMOD_System_GetVersion");

if (f2 == NULL)
return;

fmod_result = f2(&fmod_version);
ERRCHECK(fmod_result);
[/code:7nnqx8yc]

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. 😉

stem

  • You must to post comments
0
0

FMOD_System_GetVersion API takes two parameters:
FMOD_RESULT F_API FMOD_System_GetVersion (FMOD_SYSTEM *system, unsigned int *version);

see api\inc\fmod.h

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)

  • You must to post comments
0
0

Thank you!

The problem was that I only looked at the declaration in the documentation:

[quote:26ws2g2s]FMOD_RESULT System::getVersion(
unsigned int * version
);[/quote:26ws2g2s]

Stefan

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.