473,795 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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*******@SPAMc ox.net - just remove the
ANTI and the SPAM.

Thank you,
BJ
Jul 17 '05 #1
5 5049
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*******@SPAM cox.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*******@SPAMc ox.net - just remove the
ANTI and the SPAM.

Thank you,
BJ


Jul 17 '05 #2
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*****@nowher e.com> wrote in message
news:3f******** *******@news.bt click.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*******@SPAM cox.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*******@SPAMc ox.net - just remove theANTI and the SPAM.

Thank you,
BJ

Jul 17 '05 #3
On Thu, 2 Oct 2003 04:26:15 -0700, "BJ" <lt*******@SPAM cox.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

"BJ" <lt*******@SPAM cox.net> wrote in message
news:ngTeb.4881 $hp5.628@fed1re ad04...
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*******@SPAMc ox.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
comments inline:

"BJ" <lt*******@SPAM cox.net> wrote in message
news:ngTeb.4881 $hp5.628@fed1re ad04...
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3639
by: Chris | last post by:
I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed. Instead of getting my Web page, or the Web Service page, I get a page full of error text (below). I am hoping the anwser will be obvious to someone. I've tried a few things to address the problem, including
5
1749
by: Francis Shanahan | last post by:
Folks, I have a base page which is the grand-daddy of all my pages. It inherits from System.UI.Web.Page From this I inherit a layout page. From this I inherit the individual pages themselves. The problem: My pages can no longer be brought up in the designer. I'm using Visual Studio 2002 and these pages are written in asp.NET with the code
0
2092
by: Mike Schnorr | last post by:
I have a ASP.Net application that uses assemblies from several other solutions. When testing the applications on my machine I build all the referenced assemblies using nmake. The latest assemblies get placed in a common directory that is referenced by my ASP.NET app. Occasionally I receive the following error: value of type "MyNamespace.MyClassName" cannot be converted to "MyNamespace.MyClassName" (there are a lot of these for different...
0
1622
by: Matt | last post by:
When I tried to close VS.NET, it has the following error dialog: "Microsoft Development Environment cannot shut down because a modal dialog is active. Close the active dialog and try again." But I couldn't see any modal dialog, and eventually I kill the process to close VS.NET any ideas??
1
4432
by: Mary Kerrigan | last post by:
I'm tearing out my freakin' hair on this one. Trying to deploy an ASP.NET site on a Windows 2000 Advanced Server. The framework v1.0.3705 was already installed, not by me. When I tried to get to a page that accesses data, I get this error, that begins with: "Cannot execute a program. The command being executed was "c:\winnt\microsoft.net\framework\v1.0.3705\vbc.exe"..." I have searched and searched but could find no solution. I...
0
2217
by: Abhi | last post by:
The applicaiton through which the service is created, doesnt give that error. To check the exact issue, I tested with a service containing this block of code. The service gives the error when run as local system or even in an account (mine) For this block of code Private Sub Timer1_Elapsed(ByVal sender As Object, ByVal e
5
1996
by: Chris Robb | last post by:
I'm having some really odd behavior with a PHP script. I have it populating an HTML select form with a for loop. When I try the years 2006 to 1900. I get the following error: PHP Warning: Cannot modify header information - headers already sent by (output started at /Users/chrobb/Sites/city-directory/controlBar.php:54) in /Users/chrobb/Sites/city-directory/controlBar.php on line 88 I've done a fair amount of searching and it looks...
7
12186
by: Mathew Butler | last post by:
I'm investigating an issue I have when pulling data back from MS access I'm retrieving all rows from a column in a table of 5000 rows - accessing a column of type "memo" ( can be 65353 character long) . I'm pulling the data back using ODBC. Details are: Microsoft Access Driver 4.00.6306.00 Jet 4.0 release level that is currently installed (Msjet40.dll ) "Microsoft Jet Engine Library" 4.0.9025.0 After 291 rows are retreived I am...
0
1734
by: Tom | last post by:
I have a .net v2 asp.net problem. I develop on my workstation and deploy to a production server. I use compile on demand, so no pre-compile is done. When I deploy, I first must move in my new or changed pages. Then I must restart IIS. After that, everything is good, and I run for weeks without problems. If something should cause a compile ( like making a change to one of the pages and then requesting the page), the following error will...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.