LoadLibrary() freezes up for no apparent reason!

Programming, for all ages and all languages.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

LoadLibrary() freezes up for no apparent reason!

Post 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!?
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Post 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.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post 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...
Post Reply