Creating a Class Library

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Creating a Class Library

 
0
  #1
Apr 4th, 2008
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 WindowsFormRename 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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Creating a Class Library

 
0
  #2
Apr 4th, 2008
Dim xyz AS new ClassLibrary.Assembly
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Creating a Class Library

 
0
  #3
Apr 4th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,602
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 712
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Creating a Class Library

 
0
  #4
Apr 4th, 2008
>I also do not know what to write on the click event of the button.
It's kind of hard to tell you what to write when I have no idea what you want the form to do.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 43
Reputation: Yogesh Sharma is an unknown quantity at this point 
Solved Threads: 1
Yogesh Sharma Yogesh Sharma is offline Offline
Light Poster

Re: Creating a Class Library

 
0
  #5
Apr 4th, 2008
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
Last edited by Yogesh Sharma; Apr 4th, 2008 at 12:36 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Creating a Class Library

 
0
  #6
Apr 4th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Re: Creating a Class Library

 
0
  #7
Apr 4th, 2008
I didnt got it yaar,
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Creating a Class Library

 
0
  #8
Apr 4th, 2008
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.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Re: Creating a Class Library

 
0
  #9
Apr 4th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Creating a Class Library

 
0
  #10
Apr 4th, 2008
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
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC