Thursday, July 30, 2009

I know C and Visual basic programming, how do i create a DLL file that I could use in the VB programs?

I want to experiment on my visual basic program using a link to simplify my codes and that is through using DLL files. I want my DLL files to be made using C/C++ program. After creating a C program, I want to make a DLL file out of it and use this to my VB application.

I know C and Visual basic programming, how do i create a DLL file that I could use in the VB programs?
If you download VB.NET Express (Free download from Microsoft) you can use it to create DLLs
Reply:its not free Report It

Reply:Hmm strange.


Looking at Microsoft site


http://msdn.microsoft.com/vstu...





"Get it for FREE" I downloaded it for Free, installed it for Free, and have been using it for Free.





But if you say it's not free ... Shrug. Report It

Reply:The Client Application (Visual Basic)





Accessing a C++ DLL from Visual Basic is much easier than from C++. The only task that must be done is to declare the function prototype; Visual Basic will handle everything else. In order to do this, include a code module by clicking Project -%26gt; Add Module -%26gt; Open. In the new module, declare the function prototypes in the following manner:











Declare Sub TestFunc Lib "../testdll_library.dll" ()


Declare Function RetInt Lib "../testdll_library.dll" (ByVal t As Integer) As Integer

















One important note is that all parameters must be passed with the ByVal keyword. This is because Visual Basic always passes parameters ByRef by default. Since C/C++ usually passes by value, this must be specified in the Visual Basic declaration. This is all that is necessary when standard C variable types (int, long, etc.) are used, however complex data types like strings and arrays require more overhead on both the client and DLL sides.





Quote from source. Google is amazing isn't it? ;)


No comments:

Post a Comment