fr************* @web.de (Frederik Kesting) wrote in message news:<a6******* *************** ****@posting.go ogle.com>...
Hi!
I heard about the possibilty of using different languages for one
project whith the .Net Framework. Is it f.e. possible to include
Managed C++ code into a VB.Net project without changing syntax? Could
someone tell me more about interoperabilit y or just give me a tutorial
link?
greetz!
The answer is short: NO.
Your managed C++ code must be compiled with a C++ compiler (that
creates managed code) and your VB.Net code must be compiled with a
VB.Net compiler.
The interoperabilit y refer to something else: when you compile in .Net
you don't get native code (like you do with standard C++), you get
managed code in MSIL language (assemblies; there is more, but just
i'll keep it simple). Most of the times you see that assembly like a
dll or exe file. These are not normal binary files. You can include
these files in you project and use them.
For instance: you created a class, MyClass, in Managed C++. You
compile it and get a file, a.dll. Then you wanna use MyClass in one of
your VB.Net projects. You just use it like any other class written in
VB.Net (VB.Net syntax), even if the class is written in C++ managed,
with a different syntax.
and to get all working you just compile your vb.net project
referencing a.dll (the file that have MyClass implementation) - this
is done by using /r:a.dll compiler option. You don't have to do
anything else. just use the corect namespaces and refer the correct
dll.
The code written in a language must be compiled with the proper
compiler!!