Question

Link grammar is a piece of software allowing for sentence parsing. It has an API that I hope to use (Details here) however the example is written in c++ and I'm a vb.net user. I've tried adding a reference to the file named:

link-includes.h

But vs2010 doesn't allow me to select this file since it's not one of the recognised file types for a reference. I've tried adding the above file to the solution but that doesn't allow me to reference it in any way (as far as I know). Any advice/hints/suggestions would be welcome!

Was it helpful?

Solution

A VB.Net project can't directly reference a C++ header file. In order to use C++ code from VB.Net, one of the following approaches will need to be used:

  1. Compile the C++ code to a native DLL, which the VB.Net code can then P/Invoke

  2. Compile the C++ code to a native DLL, which is then exposed via COM

  3. Compile the C++ code in a C++/CLI project, which the VB.Net project can reference as another managed project (i.e., via project References)

Additional information can be found here: Invoke Native C++ DLL from .NET Code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top