Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, 1 invisible), 858 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Debugging C++ DLL #295298
10/24/09 08:31
10/24/09 08:31
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
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 Offline

Chief Engineer
jcl  Offline

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 Offline OP
Serious User
VeT  Offline 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
Code:
action box_newt()
{
	newton_addentity(me, 75, NEWTON_BOX, onforceandtorque);
}



But everything works fine with
Code:
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"


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
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 Offline
Serious User
DJBMASTER  Offline
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...
Code:
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: DJBMASTER] #296505
11/01/09 13:11
11/01/09 13:11
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
And if i dont have access to DLLs source?
Well, i can ask Julio to add function like that, but i dont think that its the best variant...


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Debugging C++ DLL [Re: VeT] #296716
11/02/09 16:10
11/02/09 16:10
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Has the Newton DLL no open or init function? I would expect that a DLL does not crash when it was properly initialized.

Re: Debugging C++ DLL [Re: jcl] #296841
11/03/09 12:25
11/03/09 12:25
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
I'll upload light version of wrapper for you, so you could see.
No, it doesnt crash while init, also it doesnt have init-function.


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
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 Offline OP
Serious User
VeT  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Here you are: http://depositfiles.com/files/ixp3badea

If 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"


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Debugging C++ DLL [Re: VeT] #296864
11/03/09 15:40
11/03/09 15:40
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I had this problem too and this wass the reason:

I create the newtonworld in my main function, but I think it is not guaranteed that entity actions run AFTER the main function. so there are crashes because the newtonworld is not created yet.

wait (1) should do in this case.

Re: Debugging C++ DLL [Re: FBL] #296870
11/03/09 16:28
11/03/09 16:28
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
That's right. Entity actions start just when the level is loaded. I'm not this familiar with Newton, but apparently it crashes when you call physics functions before creating the world.

Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1