473,663 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application won't "unload" when terminated.

Hiya,

I have a problem with my application. It hangs around in memory after
exiting (and the debugger thinks its still running; I am unable to "break"
or "stop" execution). The main loop below shows my "main" function. When
the main form is closed, this function is exited, so the "hang" occurs in
code outside of my control. I am using some COM objects (such as
IShellFolder) during running of the application, so wonder whether this kind
of thing would make any difference. How to debug such a problem anyway?

Thanks for any tips/pointers you can give me,

Try
' Create splash form.

Dim splashForm As New Splash

' Show it

Dim theResult As DialogResult = splashForm.Show Dialog()

' Success?

If Not theResult = DialogResult.OK Then
Exit Sub
End If

' Create the main form.

Dim mainForm As New MainForm

' Call the Application class Run method

Application.Run (mainForm)

Catch Ex As Exception

' Exception.

s_Log.Append(0, Ex)

End Try
Nov 21 '05 #1
2 1528
Hi Robin,
Hiya,

I have a problem with my application. It hangs around in memory after
exiting (and the debugger thinks its still running; I am unable to "break"
or "stop" execution). The main loop below shows my "main" function. When
the main form is closed, this function is exited, so the "hang" occurs in
code outside of my control. I am using some COM objects (such as
IShellFolder) during running of the application, so wonder whether this kind
of thing would make any difference. How to debug such a problem anyway?
Try Environment.Exi t(0) after Application.Run (mainForm).
Exit kills all threads, while just leaving the app kills
only the main thread.

bye
Rob


Thanks for any tips/pointers you can give me,

Try
' Create splash form.

Dim splashForm As New Splash

' Show it

Dim theResult As DialogResult = splashForm.Show Dialog()

' Success?

If Not theResult = DialogResult.OK Then
Exit Sub
End If

' Create the main form.

Dim mainForm As New MainForm

' Call the Application class Run method

Application.Run (mainForm)

Catch Ex As Exception

' Exception.

s_Log.Append(0, Ex)

End Try

Nov 21 '05 #2
I decided to solve this problem with a different approach. I deleted all of
my IShellFolder code and my own Folder and File Viewer and persuaded my
software manager to purchase a component for me that does it without hanging
:)

"Robert Jordan" <ro*****@gmx.ne t> wrote in message
news:ch******** *****@news.t-online.com...
Hi Robin,
Hiya,

I have a problem with my application. It hangs around in memory after
exiting (and the debugger thinks its still running; I am unable to
"break" or "stop" execution). The main loop below shows my "main"
function. When the main form is closed, this function is exited, so the
"hang" occurs in code outside of my control. I am using some COM objects
(such as IShellFolder) during running of the application, so wonder
whether this kind of thing would make any difference. How to debug such
a problem anyway?


Try Environment.Exi t(0) after Application.Run (mainForm).
Exit kills all threads, while just leaving the app kills
only the main thread.

bye
Rob


Thanks for any tips/pointers you can give me,

Try
' Create splash form.

Dim splashForm As New Splash

' Show it

Dim theResult As DialogResult = splashForm.Show Dialog()

' Success?

If Not theResult = DialogResult.OK Then
Exit Sub
End If

' Create the main form.

Dim mainForm As New MainForm

' Call the Application class Run method

Application.Run (mainForm)

Catch Ex As Exception

' Exception.

s_Log.Append(0, Ex)

End Try

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10844
by: Lauren Hines | last post by:
Hello, I have read numerous post stating that the only way to unload an assembly (DLL in my case) is to create a separate AppDomain, load the assembly, then unload it by calling AppDomain.Unload. When trying to delete the DLL file I get an exception that access is denied. When trying to copy over the DLL file, I get an exception that it is being used by another process.
1
1901
by: BuddyWork | last post by:
I think I've found a possible issue with .Net AppDomain.Unload when using attribute LoaderOptimization.MultiDomain. Here you will need ProcessExplorer from SysInternals to see what assemblies are loaded for a given process. You will need to add the following code into HelloWorld1.cs and compile through the CS compiler. csc HelloWorld1.cs // C# Sample Code
6
2236
by: Sacha Korell | last post by:
My customer wants a user to be logged out of the system when he uses the same browser to navigate to a different website (without explicitly logging out). In other words, if the user navigates to a different website and uses the "Back" button to get back to my application, he should have to log in again. I know that I can detect on the client when the user navigates to another website (Body OnUnload=) but I don't know how to go from...
3
1867
by: John Wildes | last post by:
Hello All I have an application that has one form. I start the application using a Application.Run(New frmMain) command in Sub Main(). When I exit, the exit menu Item simply does a Me.Close . It closes and ends the application, and closes the NotifyIcon I have specified for this application. When I use Application.Exit it closes the form and ends the application but the NotifyIcon doesn't remove itself unless you hover a mouse cursor...
0
1212
by: cherishman | last post by:
I create an Excel Addin application. When user use excel, the addin application will auto load. How can I control the loading and unloading the addin. I use office 2003. thanks!
0
1251
by: cherishman | last post by:
I create an Excel Addin application. When user use excel, the addin application will auto load. How can I control the loading and unloading the addin. I use office 2003. thanks!
2
2618
by: Wernerh | last post by:
Hi, Have created vb6 app, but cannot get it to "unload" from "Application Running" (ctrl+alt+del) on close. I have tried to find a solution here, but could not find a thread that discussed this. Thanks Werner
4
3089
by: lander | last post by:
I've read the page life cycle thing in msdn, still, i'm getting a bit confused of thinking how all the things are going under the hood... I know that when page loading, that the controls' properties is populated and when page unloading, the resources are cleared. What I want to know is what's happening behind it, that is, from the perspective of the asp.net implementor.....I'm not sure whether i've stated clearly, hope you get it.
1
3636
by: Ivan | last post by:
Hello, What I want to do is to create DLL that I can load and use and then unload when needed. What I mean by this is: After object released - dll file can be removed, etc. So, file won't be blocked. Now I use regular EXE and pass command line but I need to pass objects, so EXE doesn't work well anymore. Thank you,
0
8436
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
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8771
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
8548
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
7371
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
6186
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...
1
2763
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
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.