Click here to Skip to main content
15,885,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I need tutorial, a complete tutor to guide on how to use unmanaged code with VB. Right now I have a source code for a device which writing on C & C++ I guest, based from dependency walker.

Anyone can provide me link for this? I've been stuck with this project around 1 month. Already search on Internet but cannot find any.

If someone know how to program a device from unmanaged code, kindly teach me master.. Really appreciate your kindness


*** Edited:

The file was send as a name exampleA.dll but when I try to add reference into VB.Net, it got error not valid assembly or COM component. When I copy to system32 and regsvr32, it failed that specified module cannot be found event it exist in the system32 folder
Posted
Updated 1-Dec-13 16:11pm
v2

You can't add a reference to the .DLL because it's not a .NET or COM-based library. It's a standard C library that requires you to use P/Invoke from your managed code to call those functions.

I sure hope you have the documentation on that .DLL and the functions it exports because, without it, you have no hope of P/Invoking the functions in that library.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Dec-13 23:27pm    
My 5. I added some more links.
—SA
Even though the examples are in C#, this tutorial[^] will be very helpful to what you are trying to do.

Also see this tutorial[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Dec-13 23:27pm    
My 5. I added some more links, too.
—SA
In addition to Solution 1 and Solution 2:

The basics of P/Invoke are explained here: http://en.wikipedia.org/wiki/P/Invoke[^].

This old Microsoft tutorial is nevertheless quite actual: http://msdn.microsoft.com/en-us/library/aa288468%28v=vs.71%29.aspx[^].

This CodeProject article can also be useful: Essential P/Invoke[^].

—SA
 
Share this answer
 
Comments
Ron Beyer 1-Dec-13 23:32pm    
5!
Sergey Alexandrovich Kryukov 2-Dec-13 0:51am    
Thank you, Ron.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900