1

Short Version:

Have: DLL's Managed Code (C#/Visual Basic) from Brüel & Kjær SDK

Need: Communicate with the DLL's in our old Project Un-Managed Code (C++ Visual Studio 2005)

Long Version:

We have a project written in C/C++ (Visual Studio 2005). Now I have to implement a communication with a new device. (Brüel & Kjær 2250SDK Noice).

The problem is, Brüel & Kjær only supports you with Libraries for C# or Visual Basic (Managed-Code) (Visual Studio 2010 and higher), but our project is an old unmanaged C/C++ code.

So, the question is, how can I work with the DLL's in my old C++ Code? I don't have the source of the DLL's, I only have the DLLs.

I hope someone out there can help me with that problem. Thanks in advance!

Alan-Lee
  • 45
  • 1
  • 5
  • 1
    possible duplicate of [Calling C# code from C++](http://stackoverflow.com/questions/778590/calling-c-sharp-code-from-c) – Daniel Dinu May 04 '15 at 07:54
  • You need C++/CLI. However, I'd say you also need to ditch a 10year old IDE and use something more recent - I'm not even sure you're going to be able to use B&K's dlls with VS2005 but even if you are there should be no good reasons to stick with it. – stijn May 04 '15 at 08:04

1 Answers1

0

What you want is probably C++/CLI (Common Language Infrastructure). It basically enables you to use .NET types in C++. With this you could call a C# DLL and use the data which is provided by the DLL as the .NET type. Since you already have you application in C++ code, I guess you don't want to rewrite it completely. You'd than have to convert the managed types to unmanaged types, which is possible with C++/CLI.

If you want to know more about it, here is a lengthy MSDN article about it and here is a useful little quick tutorial.

DangerousDetlef
  • 371
  • 2
  • 11