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.

DarkBASIC Professional Discussion / DarkBASIC Pro application hangs on exit

Author
Message
Interkarma
22
Years of Service
User Offline
Joined: 13th Nov 2003
Location:
Posted: 14th Nov 2003 00:03
Hi All,

I'm developing a DLL for DBP which adds new commands to generate textures and 3D objects. One of these commands, used to save an image file, causes the DBP application thread to hang on exit.

Internally this command uses GDI+ to save an image. Specifically, I'm using the Save() method of the ATL CImage class. By commenting out the Save() command in my C++ code, or by never calling the function from DBP, the application thread does not hang on exit.

This behaviour does not happen when calling the DLL from another C++ app. Profiling shows my clean-up leaves nothing dangling in memory. It only happens after invoking CImage::Save.

Is there a known issue between DBP and external calls to GDI+ or ATL classes? Perhaps there is some additional clean up I need to perform on exit to resolve this.

I appreciate any feedback offered. Thanks!


Interkarma.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 14th Nov 2003 00:49
I have experienced a few nasty problems when trying to use image functions and GDI+, never used ATL though.


BLUE GUI Plugin: http://blue.robert-knight.net / BLUE IDE [href]http://blueide.sf.net/ - Replacement editor for DBPro[/href]
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Nov 2003 02:12
isn't ATL = Active Template Library? I know nothing about this but I do know dbp can't interop with activeX anything

just a shot in the dark

-RUST-
Interkarma
22
Years of Service
User Offline
Joined: 13th Nov 2003
Location:
Posted: 14th Nov 2003 02:48 Edited at: 14th Nov 2003 02:50
Thanks for the feedback so far.

CattleRustler, My C++ code inside the DLL is doing all the talking to ATL and GDI+. All DBP does is call a function out of a DLL, passing a string for the output filename.

As stated, the problem only happens after calling CImage::Save(). I can instantiate the ATL class, build the image, and release everything again. So long as I don't save the image, everything works fine.

Does anyone have any similar experiences writing DLLs for DBP?


Interkarma.
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 14th Nov 2003 05:01
we need one of the C++ guys here to take up this one...

-RUST-
Interkarma
22
Years of Service
User Offline
Joined: 13th Nov 2003
Location:
Posted: 15th Nov 2003 12:02 Edited at: 15th Nov 2003 12:32
Not to worry, folks. I've solved my problem by using D3DXSaveSurfaceToFile in my DLL, instead of GDI+. I'll come back to this problem after a later release of DBP.

Thanks for the help.


Interkarma.

Login to post a reply

Server time is: 2026-07-26 14:31:06
Your offset time is: 2026-07-26 14:31:06