473,385 Members | 1,461 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Classes VB6 vs. VB.NET

In VB6 i use a Form and a Class module.

Dim MyClass as New Class1

In Form_Load:
Set MyClass = New Class1

In Form_Unload:
Set MyClass = Nothing

This works in VB6
But in .NET i can not destroy the class.
The class only destroys when i Close the application.
If i use the VB6 to .NET wizard, i get an upgrade note:

UPGRADE_NOTE: Object mycls may not be destroyed until it is garbage
collected. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1029"

So how do i destroy a class in .NET

Thanks
Nov 21 '05 #1
2 1952
On Fri, 1 Oct 2004 20:19:23 +0200, "Soren Hyltoft" <sh@impuls-technic.dk> wrote:

¤ In VB6 i use a Form and a Class module.
¤
¤ Dim MyClass as New Class1
¤
¤ In Form_Load:
¤ Set MyClass = New Class1
¤
¤ In Form_Unload:
¤ Set MyClass = Nothing
¤
¤ This works in VB6
¤ But in .NET i can not destroy the class.
¤ The class only destroys when i Close the application.
¤ If i use the VB6 to .NET wizard, i get an upgrade note:
¤
¤ UPGRADE_NOTE: Object mycls may not be destroyed until it is garbage
¤ collected. Click for more:
¤ 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1029"
¤
¤ So how do i destroy a class in .NET

Try using Marshal.ReleaseComObject:

http://msdn.microsoft.com/library/de...bjecttopic.asp
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #2
On Fri, 1 Oct 2004 20:19:23 +0200, "Soren Hyltoft" <sh@impuls-technic.dk> wrote:

¤ In VB6 i use a Form and a Class module.
¤
¤ Dim MyClass as New Class1
¤
¤ In Form_Load:
¤ Set MyClass = New Class1
¤
¤ In Form_Unload:
¤ Set MyClass = Nothing
¤
¤ This works in VB6
¤ But in .NET i can not destroy the class.
¤ The class only destroys when i Close the application.
¤ If i use the VB6 to .NET wizard, i get an upgrade note:
¤
¤ UPGRADE_NOTE: Object mycls may not be destroyed until it is garbage
¤ collected. Click for more:
¤ 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1029"
¤
¤ So how do i destroy a class in .NET

Here is an example of how to use Marshal.ReleaseComObject:

http://support.microsoft.com/default...b;en-us;306682
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #3

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

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
9
by: Jack | last post by:
Hello I have a library of calculationally intensive classes that is used both by a GUI based authoring application and by a simpler non-interactive rendering application. Both of these...
9
by: Aguilar, James | last post by:
I know that one can define an essentially unlimited number of classes in a file. And one can declare just as many in a header file. However, the question I have is, should I? Suppose that, to...
12
by: Langy | last post by:
Hello I'm fairly new to C++ but have programmed several other languages and found most of c++ fairly easy (so far!). I've come to a tutorial on classes, could someone please tell me why you...
4
by: john townsley | last post by:
do people prefer to design classes for the particular job or for a rangle of tasks they might encounter now and in the future. i am doing some simple win32 apps and picking classes is simple, but...
2
by: joye | last post by:
Hello, My question is how to use C# to call the existing libraries containing unmanaged C++ classes directly, but not use C# or managed C++ wrappers unmanaged C++ classes? Does anyone know how...
18
by: Edward Diener | last post by:
Is the packing alignment of __nogc classes stored as part of the assembly ? I think it must as the compiler, when referencing the assembly, could not know how the original data is packed otherwise....
6
by: ivan.leben | last post by:
I want to write a Mesh class using half-edges. This class uses three other classes: Vertex, HalfEdge and Face. These classes should be linked properly in the process of building up the mesh by...
0
by: ivan.leben | last post by:
I am writing this in a new thread to alert that I found a solution to the problem mentioned here: http://groups.google.com/group/comp.lang.c++/browse_thread/thread/7970afaa089fd5b8 and to avoid...
2
by: Amu | last post by:
i have a dll ( template class) ready which is written in VC++6. But presently i need to inherit its classes into my new C#.net project.so if there is some better solution with u then please give me...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.