Page 1 of 1

LoadLibrary() freezes up for no apparent reason!

Posted: Sat Dec 09, 2006 1:53 am
by earlz
I'm attempting to start with some simple plugin support on my emulator but now LoadLibrary() will mysteriously crash from handle=LoadLibrary("devices/libc_video/libc_video.dll"); it doesn't give any kind of error reporting or return NULL or anything..it just silently crashes
and my dll is a simple dll with just a few types and structs in it, and it doesn't ave a DLLMain() but I've compiled dll's without it before and they work fine so what could be wrong!?

Posted: Sat Dec 09, 2006 5:28 am
by Ready4Dis
Try loading a .dll file that is on the system elsewhere that is known good, like opengl.dll or something, just to see if it crashes or returns a valid handle. If it loads, it's definitely your .dll messing things up, if it crashes, there is something wrong in your program/load library function. Half split the problem so you know where to look, maybe your assuming the program is running in one directory and it's running in another, that would normally return a NULL though for .dll not found, but who knows. I've used LoadLibrary a few times without issue, I would have to check if i've ever used DLL main, haven't touched them in a long time.

Posted: Sat Dec 09, 2006 10:09 am
by earlz
ok I found out the problem!
turns out I was calling the device function before all of my stuff was initialized hence causing it to crash...fixed it by moving my arg code down...