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.

Newcomers DBPro Corner / Ending the application

Author
Message
sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 15th Jun 2011 12:10
Hi,
I have a DarkBasic-Pro Application. If a user wants to end it and clicks on cross of the window the programm crashes. Is there any easy way to test whether the user tries to end the programm using standard-windows tools?
sberK
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Jun 2011 14:28 Edited at: 15th Jun 2011 14:29
Quote: "If a user wants to end it and clicks on cross of the window the programm crashes."

This is not standard behaviour for a DBP application. Are you using any plugins? It could be that if you aren't ending a plugin that requires it there might be a crash. One standard way around this is to compile the application as "fulldesktop" and give the user another way to end the app such as if they hit the escapekey it triggers a "Do you want to quit (y/n)?" event.



Untested and written on the fly but try it and see how you get on.

Hope that helps...

Burning Feet Man
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 15th Jun 2011 15:09
I'd hazard a guess that the program "opens" a file, but never closes it, or unloads it, or something along those lines.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Jun 2011 15:11
Good point BFM that's another possibility!

sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 15th Jun 2011 16:29
Hi,
an error in my coding, thats sound like a very probable option. Is there an easy way, to see all open file handles?
My other question is, I load some bitmaps using load bitmap,
copy it to another bitmap and use the same bitmap number again to load a new bitmap. Should I delete each bitmap before reloarding?
sberK
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Jun 2011 16:51
Quote: "My other question is, I load some bitmaps using load bitmap,
copy it to another bitmap and use the same bitmap number again to load a new bitmap. Should I delete each bitmap before reloarding?"

Shouldn't matter as far as I'm aware.

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Jun 2011 20:46
You can use the FILE OPEN() command within a FOR/NEXT loop to check all the open files.



If those bitmaps you're loading are just to grab the images with GET IMAGE you should use LOAD IMAGE instead. It does exactly the same as LOAD BITMAP with GET IMAGE... the only time you really want to use LOAD BITMAP is when you want to manipulate the image before using GET IMAGE.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Jun 2011 02:35
There are also plugins like BlitzTerrain that require you to delete their assets before you exit, or it will crash on you.

But that doesn't sound like the problem you're having. Just thought I'd throw it out there.

sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 16th Jun 2011 11:13 Edited at: 16th Jun 2011 11:16
Hi,
I extended Grog Grueslayer to loaded dlls.

However neither dlls are loaded nor files are open. Is there any similar way to test in a comparable manner for loaded plug-ins?
I have some questions regarding the difference between get image and load bitmap. I just load some png files and copy them together. Is it better to use the image or the bitmap functions. I choose the bitmap, but did not think about the difference between these two different function groups.
sberK
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Jun 2011 18:23 Edited at: 16th Jun 2011 18:23
Quote: "I have some questions regarding the difference between get image and load bitmap. I just load some png files and copy them together. Is it better to use the image or the bitmap functions. I choose the bitmap, but did not think about the difference between these two different function groups."


If you're doing something like this:


This is exactly the same thing:


Using bitmaps is just intended to set up menus/maps/whatever away from the view of the user so they don't see the image setup before it's done. Now if you're changing the image in any way before grabbing it then it's ok to use bitmaps.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Jun 2011 18:26
The DLL EXIST is only going to tell you about DLLs that you loaded with the LOAD DLL command. Plugins are included in the EXE by the compiler and are always in memory when your program is running.

If you are altering the image in some way before you use it, then you can use LOAD BITMAP, but if you are just going to use the image unaltered then use LOAD IMAGE. It's faster.

For the program to crash by clicking on the Close button, there has to be something in use that DBPro doesn't automatically clean up when it exits. Probably something you've created or opened using a plugin.

Login to post a reply

Server time is: 2024-11-22 18:56:27
Your offset time is: 2024-11-22 18:56:27