| | |
Creating a Class Library
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
Creating a Class Library
--------------------------------------------------------------------------------
1) Choose File NewProject
2) Select ClassLibrary from the project templetes.
3) Suppose I rename it to ClassLibrary.
4) Add Code inside the block code.
I write
Public Class assembly
Public Function add(ByVal x As Integer, ByVal y As Integer)
Return x + y
End Function
End Class
5) Choose Build-Build ClassLibrary.
RUNNING A DLL FILE—
1)Project-->Add WindowsFormRename it to Yogesh
2) Server Explorer-->Right Click-->Add Reference-->Open the ClassLibrary.
3)Imports Assembly
In the above imports statement, Imports assembly is there or
Imports ClassLibrary is there.
Public Class yogesh
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
I also do not know what to write on the click event of the button.
--------------------------------------------------------------------------------
1) Choose File NewProject
2) Select ClassLibrary from the project templetes.
3) Suppose I rename it to ClassLibrary.
4) Add Code inside the block code.
I write
Public Class assembly
Public Function add(ByVal x As Integer, ByVal y As Integer)
Return x + y
End Function
End Class
5) Choose Build-Build ClassLibrary.
RUNNING A DLL FILE—
1)Project-->Add WindowsFormRename it to Yogesh
2) Server Explorer-->Right Click-->Add Reference-->Open the ClassLibrary.
3)Imports Assembly
In the above imports statement, Imports assembly is there or
Imports ClassLibrary is there.
Public Class yogesh
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
I also do not know what to write on the click event of the button.
Dim xyz AS new ClassLibrary.Assembly
xyz.Add(your parameters...)
I am not VB programmer; syntax may be wrong..
xyz.Add(your parameters...)
I am not VB programmer; syntax may be wrong..
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
You may need Imports ClassLibrary.Assembly
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Apr 2008
Posts: 43
Reputation:
Solved Threads: 1
adding a function to DLL or Class Libary- Means that one we add the function in DLL,we can call this function on any form.
I want simple addtion function & this fn. can be called on any form by.
Hi Damy Ur Syntax is wrong,
dim obj as new classLibrary.assembly
I want simple addtion function & this fn. can be called on any form by.
Hi Damy Ur Syntax is wrong,
dim obj as new classLibrary.assembly
Last edited by Yogesh Sharma; Apr 4th, 2008 at 12:36 pm.
I don't write VB.NET I just help .net problem I think you got me and solved your problem
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Let's say it again
1- Right click on the project you want to add the dll to.
2- Add reference then browse your dll
3- In the .cs file you call Add method, imports the class library i.e import [ClassLibraryName]
4- Initiate a object from Add method class then call its add method.
hint: dll is the class library output
I think that's tooo clear to solve your problem or I didn't understand you well.
1- Right click on the project you want to add the dll to.
2- Add reference then browse your dll
3- In the .cs file you call Add method, imports the class library i.e import [ClassLibraryName]
4- Initiate a object from Add method class then call its add method.
hint: dll is the class library output
I think that's tooo clear to solve your problem or I didn't understand you well.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
Public Class assembly
Public Function add(ByVal x As Integer, ByVal y As Integer)
Return x + y
End Function
End Class
Calling Method--Imports ClassLibrary
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New ClassLibrary.assembly
Dim sum As Integer
sum=obj.
End Sub
End Class
Now this is the coding i m writing,See & reply
Public Function add(ByVal x As Integer, ByVal y As Integer)
Return x + y
End Function
End Class
Calling Method--Imports ClassLibrary
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New ClassLibrary.assembly
Dim sum As Integer
sum=obj.
End Sub
End Class
Now this is the coding i m writing,See & reply
Is there error?? If yes please tell me what's it, I hope there is not
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- Creating a VB dll (Visual Basic 4 / 5 / 6)
- How to create a global function/class ? (C#)
- Please Help on Visual Studio 2005 C# (C#)
- creating a .lib file in VS2005 (C++)
- Problem with Windows Service (C#)
- Linking errors while creating dll using ATL project (C++)
- Creating Amplitude in C++.net (C++)
Other Threads in the VB.NET Forum
- Previous Thread: saves the work of program in file
- Next Thread: db4o,vb.net and my sql
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic beginner bing browser button buttons center check code crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter forms ftp generatetags google hardcopy html images input insert intel internet mobile monitor net networking objects open output panel passingparameters pdf picturebox picturebox1 port position print printing problem project save searchbox searchvb.net select serial settings shutdown soap sqlserver survey table tcp temperature text textbox timer timespan toolbox transparency trim update user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year






