Solved

Calling C++ Functions from VB.Net - Tutorials

Posted on 2013-10-28
7
349 Views
Last Modified: 2013-11-07
Can anybody point me to tutorials or information on how to call C++ functions in VB.Net?

I have a capture card SDK with a bunch of C++ functions that I would like to test from VB.Net.

Many thanks.
0
Comment
Question by:jrlittle86
  • 2
7 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 39606680
The easiest way to do that would probably be P/Invoke. See http://msdn.microsoft.com/en-us/library/aa446536.aspx ("An Introduction to P/Invoke and Marshaling on the Microsoft .NET Compact Framework") which demonstrates how to make these calls by using the Windows API, which is very similar to calling 3rd party SDKs. You'll also find some more sample code at http://code.msdn.microsoft.com/VBPInvokeDll-6dade03d ("VB app P/Invokes a native DLL (VBPInvokeDll)").
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39606882
why? those were links to tutorials on how to cross program c++ from vb.net
0
 
LVL 86

Expert Comment

by:jkr
ID: 39617258
OK, so you are not asking a question when something is/was unclear or you need more information and than you grade "C"? Could you explain that?
0
 

Author Closing Comment

by:jrlittle86
ID: 39631419
I'm giving this a B grade rather than an A grade because I already planned on using P/Invoke and I had already combed through the MSDN articles, however briefly, before posting my question on the EE site.

I was hoping to find more tutorials on calling C++ Functions from VB.Net.

When somebody searches for this same question in the future, this response will be a good starting point for them. So, there is value to the answer given.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now