0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Debugging C++ DLL
[Re: VeT]
#295567
10/26/09 07:22
10/26/09 07:22
|
Joined: Jul 2000
Posts: 27,986 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,986
Frankfurt
|
I just noticed that your code looks buggy:
dFloat* globalFrame[16] = {0,1,0,0, 1,0,0,0, 0,0,-1,0, 0,0,0,1};
You probably meant to define an array of floats and not of pointers, that's why it won't work.
As to your first question, the engine loads all API(...) DLLs at the time when you see the message "compiling..." or "loading..." in the startup window.
|
|
|
Re: Debugging C++ DLL
[Re: jcl]
#296465
10/31/09 23:18
10/31/09 23:18
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
Okay, thanks for answers... but how i can get this: I get crash if i use action
action box_newt()
{
newton_addentity(me, 75, NEWTON_BOX, onforceandtorque);
}
But everything works fine with
action box_newt()
{
wait(3);
newton_addentity(me, 75, NEWTON_BOX, onforceandtorque);
}
newton_addentity() calls some functions from DLL... at the first look, they are not loaded while calling them, without "wait"
|
|
|
Re: Debugging C++ DLL
[Re: VeT]
#296488
11/01/09 07:25
11/01/09 07:25
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
I may be talking rubbish here, but bare with me as i have little experience with DLLs. Is it possible to send a windows message from the DLL to the engine window. When the DLL is loaded, the entry point function is called, where you can handle 'DLL_PROCESS_ATTACH'. Would it be possible to use SendMessage to send a custom window's message to the engine, saying "i'm loaded!". You could then just handle that in the engine WndProc, and set a variable like 'dll_loaded = 1;'. Then you know the action will work properly. This might not be possible, I don't know, it's just a little theory i had. Maybe something like this...
BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpReserved )
{
switch( fdwReason )
{
case DLL_PROCESS_ATTACH: // Dll is loaded
// Get handle to caller window
// Send a custom message using SendMessage
break;
}
}
The only problem I can see from this is that the message is sent before the WndProc starts. LoadLibrary is probably still the best solution for you if you want to know if your DLL is loaded.
Last edited by DJBMASTER; 11/01/09 08:33.
|
|
|
Re: Debugging C++ DLL
[Re: VeT]
#296846
11/03/09 12:48
11/03/09 12:48
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
Here you are: http://depositfiles.com/files/ixp3badeaIf you would launch main.c, everything must work fine: items (ball, capsule and so on) must collide with blocks and models. Now, open map10.c and comment any line with "wait(3);".. then launch main.c again and you would get crash. I cant find another explanation, except of "DLL didnt had enough time to load"
|
|
|
|