By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,866 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,866 IT Pros & Developers. It's quick & easy.

"Cannot Quit" error in application when shutting down WinNT 4.0

P: n/a
BJ
The application I have been developing is great except one flaw. When
Windows NT shuts down, it doesn't send the Event to my application (if it
did, it would close all of the open forms and kill an activity flag I create
on launch) and an error comes up that says "Cannot Quit". I have no idea
where this error is coming from as I did put it in there.

I am unsure if this is because of the hidden form which has a bunch of
timers on it (I made it visible and it still did not work) or because my
primary form was orginally programmed with VBA and I don't have the time to
rewrite it in full VB (several thousand lines of code). I use a ton of APIs
for my application to do its work, but the most used is the rasapi32.dll (to
check for any connections), kernal32 (for drive data and process handling)
and mpr.dll (for mapped drives management). imcp.dll, advapi.dll and
wsock32.dll are also used infrequently. The primary form and the timer form
(which is in full VB) are the only two forms consistently loaded. I have no
errors if the program is shutdown via any other method (process kill, normal
shutdown, automated shutdown, etc). I am using Visual Basic 6.0 SP5.

I am at a loss on this and would appreciate any feedback you can provide.
The program code itself is quite long and since it is work-for-hire, I
cannot post the code. My email is lt*******@SPAMcox.net - just remove the
ANTI and the SPAM.

Thank you,
BJ
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I have an incredibly complicated App

Parts are written in VBA
Other bits are written in VB
It makes extensive use of the API
- and lots of Timers
.... but there is something wrong ...

Are there any psychics out there ?
On Thu, 2 Oct 2003 03:40:15 -0700, "BJ" <lt*******@SPAMcox.net> wrote:
The application I have been developing is great except one flaw. When
Windows NT shuts down, it doesn't send the Event to my application (if it
did, it would close all of the open forms and kill an activity flag I create
on launch) and an error comes up that says "Cannot Quit". I have no idea
where this error is coming from as I did put it in there.

I am unsure if this is because of the hidden form which has a bunch of
timers on it (I made it visible and it still did not work) or because my
primary form was orginally programmed with VBA and I don't have the time to
rewrite it in full VB (several thousand lines of code). I use a ton of APIs
for my application to do its work, but the most used is the rasapi32.dll (to
check for any connections), kernal32 (for drive data and process handling)
and mpr.dll (for mapped drives management). imcp.dll, advapi.dll and
wsock32.dll are also used infrequently. The primary form and the timer form
(which is in full VB) are the only two forms consistently loaded. I have no
errors if the program is shutdown via any other method (process kill, normal
shutdown, automated shutdown, etc). I am using Visual Basic 6.0 SP5.

I am at a loss on this and would appreciate any feedback you can provide.
The program code itself is quite long and since it is work-for-hire, I
cannot post the code. My email is lt*******@SPAMcox.net - just remove the
ANTI and the SPAM.

Thank you,
BJ


Jul 17 '05 #2

P: n/a
BJ
Despite the complexity of the application, I assure you my only error and
issue is when Windows NT shuts down. Otherwise, the program works without
any problems or errors.

My goal in asking this group is to see if anyone knows what would cause the
message "Cannot Quit". Something had to pop that message up, be it the VB
runtime libraries or the APIs.

Thanks,
BJ

"J French" <er*****@nowhere.com> wrote in message
news:3f***************@news.btclick.com...
I have an incredibly complicated App

Parts are written in VBA
Other bits are written in VB
It makes extensive use of the API
- and lots of Timers
... but there is something wrong ...

Are there any psychics out there ?
On Thu, 2 Oct 2003 03:40:15 -0700, "BJ" <lt*******@SPAMcox.net> wrote:
The application I have been developing is great except one flaw. When
Windows NT shuts down, it doesn't send the Event to my application (if it
did, it would close all of the open forms and kill an activity flag I createon launch) and an error comes up that says "Cannot Quit". I have no idea
where this error is coming from as I did put it in there.

I am unsure if this is because of the hidden form which has a bunch of
timers on it (I made it visible and it still did not work) or because my
primary form was orginally programmed with VBA and I don't have the time torewrite it in full VB (several thousand lines of code). I use a ton of APIsfor my application to do its work, but the most used is the rasapi32.dll (tocheck for any connections), kernal32 (for drive data and process handling)and mpr.dll (for mapped drives management). imcp.dll, advapi.dll and
wsock32.dll are also used infrequently. The primary form and the timer form(which is in full VB) are the only two forms consistently loaded. I have noerrors if the program is shutdown via any other method (process kill, normalshutdown, automated shutdown, etc). I am using Visual Basic 6.0 SP5.

I am at a loss on this and would appreciate any feedback you can provide.
The program code itself is quite long and since it is work-for-hire, I
cannot post the code. My email is lt*******@SPAMcox.net - just remove theANTI and the SPAM.

Thank you,
BJ

Jul 17 '05 #3

P: n/a
On Thu, 2 Oct 2003 04:26:15 -0700, "BJ" <lt*******@SPAMcox.net> wrote:
Despite the complexity of the application, I assure you my only error and
issue is when Windows NT shuts down. Otherwise, the program works without
any problems or errors.

My goal in asking this group is to see if anyone knows what would cause the
message "Cannot Quit". Something had to pop that message up, be it the VB
runtime libraries or the APIs.


More likely some 3rd party thing that you have inadvertantly
incorporated

Ill behaved - but informative
Jul 17 '05 #4

P: n/a

"BJ" <lt*******@SPAMcox.net> wrote in message
news:ngTeb.4881$hp5.628@fed1read04...
The application I have been developing is great except one flaw. When
Windows NT shuts down, it doesn't send the Event to my application (if it
did, it would close all of the open forms and kill an activity flag I create on launch) and an error comes up that says "Cannot Quit". I have no idea
where this error is coming from as I did put it in there.

I am unsure if this is because of the hidden form which has a bunch of
timers on it (I made it visible and it still did not work) or because my
primary form was orginally programmed with VBA and I don't have the time to rewrite it in full VB (several thousand lines of code). I use a ton of APIs for my application to do its work, but the most used is the rasapi32.dll (to check for any connections), kernal32 (for drive data and process handling)
and mpr.dll (for mapped drives management). imcp.dll, advapi.dll and
wsock32.dll are also used infrequently. The primary form and the timer form (which is in full VB) are the only two forms consistently loaded. I have no errors if the program is shutdown via any other method (process kill, normal shutdown, automated shutdown, etc). I am using Visual Basic 6.0 SP5.

I am at a loss on this and would appreciate any feedback you can provide.
The program code itself is quite long and since it is work-for-hire, I
cannot post the code. My email is lt*******@SPAMcox.net - just remove the
ANTI and the SPAM.

Thank you,
BJ


If you're using Office automation this is kinda infamous problem especially
if you have hidden forms.

Check your code for automation object declaration. Declare each object as a
new variable.

On your query unload, bring out invisible objects, release the objects
properly and set things to nothing to make sure things are clean..
Jul 17 '05 #5

P: n/a
comments inline:

"BJ" <lt*******@SPAMcox.net> wrote in message
news:ngTeb.4881$hp5.628@fed1read04...
The application I have been developing is great except one flaw. When
Windows NT shuts down, it doesn't send the Event to my application
Hard to believe. Can you put msgbox code in there for testing purposes, and be
certain about it? Put one in the QueryUnload event of every form.
(if it
did, it would close all of the open forms and kill an activity flag I create
on launch)
When you think your program has closed all of its forms, have it check the value
of Forms.Count.
and an error comes up that says "Cannot Quit". I have no idea
where this error is coming from as I did put it in there.


I'm pretty sure that is Windows itself (or Windows Explorer, if you like).

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.