Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / umm... problem....

Author
Message
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 19th Sep 2004 10:30
I'm working on a plugin, which under certain conditions will cause a DBP program to just dissapear magically. No error message, it just closes. This has happend to me before quite alot, anybody know what could cause this? Anybody having the same problem?

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Sep 2004 10:40
This happens to me whenever I forget to force the inclusion of a DBPro DLL that my code depends upon, or sometimes when I use an uninitialised pointer.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 20th Sep 2004 11:07
The funny (not laughing though) thing is that when I call the same functions from C++ as a stand-alone executable instead of a plugin, everything runs fine.

Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 20th Sep 2004 14:09
I've experienced this too, but have gone to the lowest level of debugging to find the cause of it. It happens to be the stack. When DBP calls your command it pushes all the variables on to the stack, but since it performs a call instruction you'll get the return stored on top of that plus an extra item on the stack from the base pointer being saved when your function starts. Your return back to the main program code plus dbp's popping those variables off the stack after the return doesn't clear all those items stored on the stack.

There are a few different cases with this, but it all ends up in the same result, after a few do..loop cycles the stack is completely corrupted and your program exits. This reply was most likely confusing, but it's one of the major reasons why a plugin case cause an exit like that.

P.S. Another issue was the same one IanM stated.
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 21st Sep 2004 01:26
how do you debug a plugin?

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Sep 2004 02:25
It depends on your IDE - you can find several methods here : http://forum.thegamecreators.com/?m=forum_view&t=27222&b=8&p=1

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Torrey
19
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 21st Sep 2004 07:44
I use Ollydbg for debugging everything.
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 21st Sep 2004 22:20
I just found out what I was doing wrong in this case.
All I'll say is that it involves two DBP instalations.

Login to post a reply

Server time is: 2024-04-20 08:02:19
Your offset time is: 2024-04-20 08:02:19