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.

Author
Message
A r e n a s
18
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 9th Aug 2010 20:14
Hey,

I've been working on a program for some time now. Its been working fine, I've been using bbb GUI and things like that with no problem at all. The problem is, when I reset the display mode to a new one (chosen by the user in the options menu) it causes a crash a few seconds after the program resumes the GUI. The GUI works fine as soon as you return, its a few seconds after returning when the crash occurs.

Now I have removed this small amount of code causing the problem, every few seconds after the GUI starts the program experiences the crash!!!!

This is the most frustrating problem ever, its ruined my code which is over 20,000 lines long. Its similar to the situation where the program enters a loop it can not exit, which is not the case as I have checked all loops...


I owe anyone who is able to solve this problem,

Thanks,

James

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 9th Aug 2010 21:42
I believe SET DISPLAY MODE command deletes all of your loaded media (objects, images, etc.) when you call it. Perhaps you could have any display changes take effect the next time the program is run to avoid this?

Also, if you are using a GUI DLL, anything it does in its setup/initialization command might get erased too. Maybe calling the GUI's setup command again after changing the display mode will help. You might want to do the same for any other DLLs you are using.

I'm not sure if that'll work, but I've had a similar problem with Cloggy's D3D plugin not working after a display mode change.

You said you removed the problematic code-- was that the display changing code? Try removing the display changing code if you haven't already and see if that works.


Guns, cinematics, stealth, items and more!
A r e n a s
18
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 9th Aug 2010 22:08
I removed the display code and it had no effect, I figure the best response to the display code problem is to combat that and look else where for any other problems after.

I had the idea of restarting my program. I was wondering if its possible to have it automatically do this. Ive linked it to a file which waits 1000 miliseconds then reopens the editor. All wait flags are set to 0. This doesnt work...

What Ive got working to a degree is running the program through a bat document. This has the problem that the bat document lingers open until the editor closes. How to a set a waitflag of 0 in the editor?

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Aug 2010 22:09
The only way to reset the display mode without screwing things up that I've come across is to have it as a setting in a data file which is read when the exe starts (before the media is loaded etc.) and then restart the exe to apply the changes. That's how I did it with "Odd Blox" anyway.

You just have to make sure the user knows that a "Restart is required!"...

A r e n a s
18
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 9th Aug 2010 22:18
Ive set it up so the user must do it manually because I cant be bothered messing about with an automated system...

Im still getting this problem. But now its purely random... My editor is simply a grid where you connect the dots to draw lines. Sometimes I open my editor and draw 30 lines then get a crash, other times I can open it and draw 2 lines and get a crash.

I cant begin to debug this problem until I can replicate it... I've also checked all loops which open at any point in the drawing of a line, all of those loops break as they should.

Any more ideas as to what the problem is?

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Aug 2010 22:24 Edited at: 9th Aug 2010 22:25
Not without consulting the old crystal ball I fear. or some code...

EDIT: 20,000 lines eh? I'll give the crystal ball a polish!

A r e n a s
18
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 9th Aug 2010 23:06 Edited at: 9th Aug 2010 23:07
In an addition to the mix, is there a decompiler for DB Pro? Ive lost some source code from a seperate executable in the program :/ It was about 500 - 1000 lines which I dont really want to retype...

I think I may have figured out the problem though. It seems I get the problem much less regularly when I use the program at lower resolutions. So now I have put a cap of 900 by 800 as the highest resolution which seems to run with out this error.

A new problem occurring as an old problem is solved; Programming

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Aug 2010 23:12
Quote: "A new problem occurring as an old problem is solved"

I think I just gained a new moto!!

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 9th Aug 2010 23:18
Glad you found a fix

Quote: "In an addition to the mix, is there a decompiler for DB Pro? Ive lost some source code from a seperate executable in the program :/ It was about 500 - 1000 lines which I dont really want to retype...
"

Don't compile anything else! If you haven't compiled anything since you compiled your source code, you can still retrieve it. Go to DBPro's TEMP folder:

"Dark Basic Professional\TEMP"

and open up FullSourceDump.dba. The last code you compiled should be in there. If you've compiled something else though I can't help you


Guns, cinematics, stealth, items and more!
A r e n a s
18
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 9th Aug 2010 23:30 Edited at: 9th Aug 2010 23:32
Quote: "I think I just gained a new moto!!"


Its royalty free

Its the rush after solving a problem that I love about programming The harder the problem the better the feeling

Quote: "Don't compile anything else!"


I've compiled the main program several times since then I have the old executable still, I just cant modify it at all... I find it funny how people always lose the source code but ive never once lost the executable

I'll learn in future not to write to the dbpros and to write to the dbo if I want to copy and compile something quickly

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 12th Aug 2010 16:41
I hate losing code. Anti virus scans have cause me some hassle in the past deleting stuff on auto scans Never noticed until one day I went to my back ups and found them all gone. I have lost the code for a Death chase clone, a boat racing game I did, a res evil style thing I started in Db many years ago, a desert strike remake, a commando remake.. Oh loads I try not to think about em lol.
I tend to have lots of copies of any project I have dotted about now, gets annoying, but at least you can revert to older versions.

http://s6.bitefight.org/c.php?uid=103081
A r e n a s
18
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 12th Aug 2010 16:50 Edited at: 12th Aug 2010 17:53
True, I now have 5 backups of my code

The annoying thing about my bug now is that it seems to have been 'laying low' for a few days and its started to occur on the lower resolutions now I think it could be a virus as the problem seems to progress through my display modes...


EDIT

Hey guys!

Some of you may be interested to know that I have been able to replicate this bug, and now diagnose successfully what's wrong!!! What I believe to be the problem ties into the problem with the display resolutions and everything

When you click on my editor, it auto locks to a dot. If you don't click near enough nothing happens. I adjusted the system to allow other for alternative resolutions. However... I never modified the detection loop system. If you click near enough the loop locks to a dot. If you don't the parameter to break the loop never kicks in and it continues a loop

The dots are every 20 pixels. On high resolutions its harder to click as the dots are smaller so there's more chance for you to click in the void between them. When you closed the display mode change the close button was directly above one of these voids so you entered the crash every close

Im quite proud of that solve

Login to post a reply

Server time is: 2026-07-25 23:12:06
Your offset time is: 2026-07-25 23:12:06