473,473 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Instatiating A Class

I have a console application. The "main: driver instantiates a class which
does all of the work.

I decided that I wanted to create a Windows From which would call the class
which was created in the console application. It has been forever since I
worked with a Windows application, but there is absolutely nothing to this
Windows form. When I press the button on the form which will eventually
instantiate an instance of the class noted above, I get a "TypeLoadException"
with the message "Could not load GLBatch.Comboedits.ComboEditReport from
assembly ComboEdits. "GLBatch.Comboedits.ComboEditReport" is the class I am
trying to create an instance of.

If I am debugging, it never gets to the code which is attempting to
instantiate the class or any of the code associated with the button which is
pressed...

What am I missing? (I have a reference to the assembly)
Jun 30 '07 #1
1 1367
Not exactly sure from reading your post what may be going on but I suspect
the key phrase is that the class was originally "in a console application".
Try this:

1) create a new class library project, put your class code in it, and make
sure it compiles. It should be a dll.
2) In your windows forms app, set a PROJECT reference to this class library
project.
3) see if you can get it to work. (A "using xzy.myclass" statement at the
top of your Form class will help.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"OldButStillLearning" wrote:
I have a console application. The "main: driver instantiates a class which
does all of the work.

I decided that I wanted to create a Windows From which would call the class
which was created in the console application. It has been forever since I
worked with a Windows application, but there is absolutely nothing to this
Windows form. When I press the button on the form which will eventually
instantiate an instance of the class noted above, I get a "TypeLoadException"
with the message "Could not load GLBatch.Comboedits.ComboEditReport from
assembly ComboEdits. "GLBatch.Comboedits.ComboEditReport" is the class I am
trying to create an instance of.

If I am debugging, it never gets to the code which is attempting to
instantiate the class or any of the code associated with the button which is
pressed...

What am I missing? (I have a reference to the assembly)
Jun 30 '07 #2

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

Similar topics

1
by: Murat Tasan | last post by:
hi, i am having a small problem with constructing an inner class. i am using an inner class (and not a static nested class) because the methods of the inner class need access to the enclosing...
2
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be able to check all the methods defined in B #and A,...
1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class...
5
by: kuvpatel | last post by:
Hi I want to refer a class called LogEvent, and use one of its methods called WriteMessage without actually having to create an instance of Logevent. I have tried using the word sealed with...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
4
by: Ulrich Hobelmann | last post by:
Hi, how do I correctly instantiate a template container? Everywhere I look they only mention in-place containers, i.e. construction on the stack like "List<Bla> myList;". I tried List<sometype...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
0
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,...
0
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,...
0
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...
1
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
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...

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.