Found the following interesting discussion in the Newsgroups:
| VB Calling a C or C++ Function? by:Anonymous | |
| I have written an Extensive test application in VB and long and detailed Algorithm that the application stresses and tests. The problem is that now that I have the algorithm perfected, I had to re-write it in C++. And since the algorithm, which is a function accepting three values (byval) and returning one, is going to be used in an embedded application I need to test the C function to same degree that I have tested the VB function before I release it. How do I call a C or C++ function in VB.NET? Doesn't the .NET frame work make this easier without having to write a complicated COM wrapper? Randy Randy.york@baesystems | |
| Reply: by:yEaH rIgHt | |
| Is this function in a dll? If so, use Platform Invoke. | |
| Reply: by:Anonymous | |
| No, its a seperte .cpp file. | |
| Reply: by:yEaH rIgHt | |
| It must be put in a dll if you eant to use it. | |
| Reply: by:Brian Henry | |
| a cpp file is an uncompiled file, along with .h header files.. you must compile them first into a windows dynamic link library (DLL) then you can use them by doing PInvoke DLLImport calls in your vb.net application | |
Posted by Xander Zelders

0 Comments:
Post a Comment
<< Home