|
-
Dec 29th, 2002, 02:23 AM
#1
Thread Starter
Hyperactive Member
objects staying in memory - RESOLVED
what do people here think is the best way to remove an object from memory? for example, if have:
Code:
Dim wrdApp As New Word.Application()
Dim wrdDoc As Word.Document
:
:
:
:
wrdDoc = Nothing
wrdApp = Nothing
now when i step through the code with the windows task manager open (viewing processes), I see winword.exe appear after the line "dim wrdApp" in the code.
however, after i set wrdApp to nothing, the file is still running around. hence after running this code 6 times, i have 6 different instances of winword.exe running.
i have tried using GC.Dispose but this too does nothing to the processes.
does anyone have any better ideas or suggestions?
Last edited by stingrae; Mar 10th, 2003 at 06:44 PM.
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Dec 29th, 2002, 04:12 AM
#2
Fanatic Member
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
Dec 29th, 2002, 04:19 AM
#3
Thread Starter
Hyperactive Member
oops. i meant GC.Collect instead of GC.Dispose.
that didn't work for me.
cheers,
stingrae
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Dec 29th, 2002, 05:32 AM
#4
Sleep mode
That happens in vb.net environment , I was having similar problem .I was trying to force GC to fire as need but it works in random interval.anyways, why don't you try another way ,such this
Kill an Application
dunno if it's of help .
-
Dec 29th, 2002, 05:11 PM
#5
Thread Starter
Hyperactive Member
thanks pirate, nice idea.
do you know what happens though if the user has other instances of word open? will it close the one that my application opened, or close all?
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Mar 10th, 2003, 06:43 PM
#6
Thread Starter
Hyperactive Member
took me 3 months, but i finally figured it out!
Code:
Dim wrdDoc As Word.Document
.
.
.
.
CType(wrdDoc, Word._Document).Close()
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|