Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How to Make DLL Using Visual Basic.Net (Part 2)

Author: DevASP
Download Source Code : 343_MyDLL.zip

This is a Advance topic but if beginner study this they can do this easily. In this simple article you will learn to make DLL (Dynamic Link Library) in VB.Net application.

Follow these steps to  make new DLL

Fileà New à Project

 

Now open a new window with title New Project. Now select Class library from this and write its name MyDLL and Press OK.

 

Now there is no form in this project there it shows Class1.vb file. Now you can write code of your specified function which you want in your DLL.

 

Public Class Class1

 

End Class

Initially here is this code only for class. Now you can create your own function in this class. We will write functions for addition of two number, subtraction of two numbers, multiplication of two numbers, division of two numbers.

Public Class Class1

 

    Public Function ADD(ByVal first As Integer, ByVal sec As Integer)

        Dim abc As Integer

        abc = first + sec

        Return abc

    End Function

 

    Public Function Subtraction(ByVal first As Integer, ByVal sec As Integer)

        Dim abc As Integer

        abc = first - sec

        Return abc

    End Function

 

    Public Function Multiplication(ByVal first As Integer, ByVal sec As Integer)

        Dim abc As Integer

        abc = first * sec

        Return abc

    End Function

 

    Public Function Division(ByVal first As Integer, ByVal sec As Integer)

        Dim abc As Integer

        abc = first / sec

        Return abc

    End Function

 

End Class

Now This is the code and your own DLL is ready for attach with some other application.

Article Comments
Refering to the first step -'Now open a new window with title New Project. Now select Class library from this and write its name MyDLL and Press OK.' I could not find 'Class Library'. Can you guide? I am a beginner. Thanks

Posted on 12/15/2006 2:13:11 PM by Anamika

hello anamika..i think ur visual studio has not been installed fully ... just update it...its my suggestion only.NOt conclusion

Posted on 2/7/2007 8:44:08 AM by karan

hello..its useful to me...but tell me how to execute it and run plz

Posted on 2/7/2007 8:46:36 AM by karan

if you just build the project at this point the dll will be created. to access it in another vb.net app add it as a reference and then use imports projectname.classname to access the functions

Posted on 5/17/2007 9:53:39 PM by sunny

hi there, I was woundering if you had tested this code - I cant get the DLL to work, unable to find the 'entry point'

Have you any hints?

ta

Matt

Posted on 6/10/2007 11:30:57 AM by matt

Hello .. your example is very importance for me Please tell me how to create and execute dll file ...

Posted on 7/17/2007 1:08:34 AM by Nimol

Hello your example is very importance for me pls tell me how to run this dll file pls.

Posted on 7/17/2007 1:13:48 AM by Nimol

This article is not complete. Should have provided how to test the DLL also.

Posted on 6/12/2008 4:20:57 AM by Phani Kumar C

I have compile dll import in vb 2008
But I do not know how to get result using it

Posted on 9/14/2008 1:07:27 PM by Badmaas

How can I use the functions in Access 2007?

Posted on 11/13/2009 3:27:31 AM by Anders

Hi Anders,

You can use this DLL in .net applications.

Thanks.

Posted on 11/13/2009 4:44:54 AM by zunnair

When I call the function, I got error 453 (Can't find DLL entry point [function_name] in [file_name]).

What is the syntax for call and declaere the function in Access 2007?

Posted on 11/24/2009 4:59:12 AM by Anders

Hi Anders,

Please review this article, it will help you

http://www.devasp.net/net/articles/display/345.html

Thanks.

Posted on 11/24/2009 6:58:15 AM by zunnair

Very nice.

Posted on 1/11/2010 9:23:21 PM by thriveni

please show the correct steps how to create and use a dll is asp.net

Posted on 3/24/2010 10:45:08 AM by mohan

Hiii
this is not a complete article for building assemblies plz give the suitable steps for creating .dll file

Posted on 3/25/2010 2:31:20 AM by mandar

I have a .DLL file compiled from vs.net 2008 and I would like to use it in my vs.net 2002 project. I do not have time to convert all my vs.net 2002 project files to VS.NET 2008.

Is there other solution to include it in my vs.net 2002? If yes, how?

Posted on 3/29/2010 1:52:13 AM by Eric

thank you. That was really helpful for me

Posted on 4/8/2010 11:25:22 AM by Eko

how to use above dll(sub,add etc.)in next another application by making its object(please send with coding

Posted on 5/4/2010 12:11:14 AM by JASWINDER

thank you. That was really helpful for me,and others......

Posted on 5/12/2010 6:49:11 AM by jkking

i have visual studio .net 2003. to get a class library, hold Ctrl+Shift+A and search for Class

Posted on 7/27/2010 11:34:57 AM by Bygor

can u plz guide how to convert the into .dll using VBS

Posted on 8/11/2010 8:20:55 AM by rakshith

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< What is DLL and What are its Uses (Part 1)

Disclaimer - Privacy
© 2002-2017 DevASP.net