473,499 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to invoke the ClassLibrary?

yxq
Hello,
I writed some classes(but not a class) in a ClassLibrary and builded a
test.dll file, but how to invoke the test.dll?

'test.dll//////////////////////

Moudle MyTest
Public class A
...
End Class

Public class B
...
End Class

Public class C
...
End Class
End Module

I have referenced the test.dll in my new project, but do not know how to use
Class A, B, C.

Thank you
Apr 4 '06 #1
3 1236
"yxq" <ga***@163.net> schrieb:
I writed some classes(but not a class) in a ClassLibrary and builded a
test.dll file, but how to invoke the test.dll?

'test.dll//////////////////////

Moudle MyTest
Public class A
...
End Class

Public class B
...
End Class

Public class C
...
End Class
End Module

I have referenced the test.dll in my new project, but do not know how to
use Class A, B, C.


Remove the 'Module' declaration around the classes and simply use the
classes as you would do with classes which are part of other libraries:

\\\
Imports ClassLibrary1 ' Importing the DLL's namespace.
....
Dim c As New C()
....
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 4 '06 #2
If you've referenced the dll for the class library, then just add the Imports
statement to the module or class in which you want to use the library
classes. Then:

dim myClass as New Class A, etc.

However, unless your classes in the Class Library are really tested and
won't need and changes, the easiest way is to add the Class Library project
to your solution in which you will use the Class Library. That way, you can
easily change any of the classes in the class library and/or add to it
quickly within your solution.
--
Dennis in Houston
"yxq" wrote:
Hello,
I writed some classes(but not a class) in a ClassLibrary and builded a
test.dll file, but how to invoke the test.dll?

'test.dll//////////////////////

Moudle MyTest
Public class A
...
End Class

Public class B
...
End Class

Public class C
...
End Class
End Module

I have referenced the test.dll in my new project, but do not know how to use
Class A, B, C.

Thank you

Apr 4 '06 #3
Add the dll to the project references. You may also need to add the class's
namespace to the 'imports' in your project.

Reference methods from your classes by instantiating them first:

Dim aclass As A = New A

then call methods/properties from the instance:

aclass.myProperty = "something"
aclass.myMethod()

You should be able to bring it together fairly easily - if you can't then
see here:

http://msdn.microsoft.com/vstudio/express/vb/learning/
Troy
"yxq" <ga***@163.net> wrote in message
news:ep****************@TK2MSFTNGP02.phx.gbl...
Hello,
I writed some classes(but not a class) in a ClassLibrary and builded a
test.dll file, but how to invoke the test.dll?

'test.dll//////////////////////

Moudle MyTest
Public class A
...
End Class

Public class B
...
End Class

Public class C
...
End Class
End Module

I have referenced the test.dll in my new project, but do not know how to
use Class A, B, C.

Thank you

Apr 4 '06 #4

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

Similar topics

0
1961
by: Will Waggoner | last post by:
Ok, I've been hung up on this issue for quite some time now and I would like some help in getting it to work. I think this may be a setup issue but I'd like to ask your eminences first. Here's...
1
1476
by: PEACEMAKER | last post by:
I'm writing a custom config file for my classlibrary dll. However when I try to load the config file the directory it points to is the folder of the application that called the dll. Is there a way...
1
2205
by: Tom Roach | last post by:
Need to create first simple C# ClassLibrary with string property accessible from VB 6.0 application. Have .NET-created, regasm-registered, and VB-accessed a prototype --> VB can "see" the property...
5
2924
by: Wayne Gibson | last post by:
Hi, Was wondering if anybody could help. I'm slowly trying to migrate over to the .NET using windows forms, but still have a need to support existing systems developed in MSVC 6 using MFC and...
3
2246
by: Rene | last post by:
I notice that VS lets you choose to create a WindowsControlLibrary and ClassLibrary, I created a class library and then added a user control and it let me do that. I am assuming that the opposite...
7
21127
by: A.M-SG | last post by:
Hi, We have a class library application that needs to read some application settings from it's own app.config file. I assume that a ClassLibrary.DLL can have a app.config file, but...
2
2501
by: Poobalam | last post by:
Hi, I just got VS.NET 2005. It has a new template called WebControlLibrary. I normally use ClassLibrary to build my business logic and use that dll into ASP.NET project. However I'm assuming...
7
10102
by: Stefan | last post by:
Hi! I´m creating a classlibrary project. The output will be a dll. This dll will have to read some settings from some kind of config-file. Normally, when creating a standard .exe-program I use...
1
1302
by: Janus | last post by:
Hi all, I've got a third party class library that i want to use in an 'old' MFC project (actually i need it in a Borland C++ builder project, but if i can use it in MFC i propably can convert it...
0
7007
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...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
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,...
1
4918
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
4599
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
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...
1
664
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.