Thread View: borland.public.cppbuilder.deployment
3 messages
3 total messages
Started by Halfo
Wed, 17 Nov 2004 02:12
Application->Terminate(); Don't stop de application???
Author: Halfo
Date: Wed, 17 Nov 2004 02:12
Date: Wed, 17 Nov 2004 02:12
23 lines
1634 bytes
1634 bytes
I got a normal application with a DataModule.
Application->Initialize();
Application->CreateForm(__classid(TmodDB), &modDB);
Application->CreateForm(__classid(TwndMain), &wndMain);
Application->Run();
in the event DataModuleCreate of the DataModule I check the connection
to the DB, if it fails I want to close the program.
I try using:
Application->Terminate();
but the aplication don't stop at this moment an execute the following
code for some time (causing errors).
Do I can't use Terminate() before call Application->Run(); ????
How can i performe this exit?
Thanks
David
Re: Application->Terminate(); Don't stop de application???
Author: hans galema
Date: Wed, 17 Nov 2004 10:54
Date: Wed, 17 Nov 2004 10:54
36 lines
1965 bytes
1965 bytes
Halfo wrote:
> I try using:
>
> Application->Terminate();
>
> but the aplication don't stop at this moment an execute the following
> code for some time (causing errors).
>
> Do I can't use Terminate() before call Application->Run(); ????
Think so.
> How can i performe this exit?
Create your modDB dynamic. And use a bool to indicate that the application
should run.
Someting like:
bool startapplication = true;
modDB = new TmodDB (NULL );
// make it in such a way that TModDB can
// set startapplication. This is possible by adding
// an extra parameter or making the bool global.
if ( startapplication )
{
Application->Initialize();
Application->CreateForm(__classid(TwndMain), &wndMain);
Application->Run();
}
Hans.
Re: Application->Terminate(); Don't stop de application???
Author: Vladimir Stefanovic
Date: Thu, 18 Nov 2004 18:58
Date: Thu, 18 Nov 2004 18:58
5 lines
1095 bytes
1095 bytes
Consider using simple 'return' if you are still in WinMain. Best regards, Vladimir Stefanovic
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads