   [.net] Using C++ code in C#?
  I recently discovered C#, and I absolutely love it. I can ramble on about the things I love, but that's not the point right now.What I'd like to do is use C# for developing my tools, but I still want to use some C++ modules I have lying around. For example, I want to do OpenGL rendering on a rendering context, but I'd like to use C++ for this, simply because I know how it's done in C++ and all my existing OpenGL-related code is in C++. Also I have some modules/libraries/etc. that I use a lot, and I would really like to combine these with a nice C#-driven application.Is this at all possible? If so, how? (I don't need every detail right away, but please just point me to some spot to start out.) Do I need to put all C++ code in a library and load that somehow?Basically I just don't have any idea if this is at all possible, and how. ANY help is appreciated. Thanks a lot!   
  You can use c++ dlls in c#, you need to read up on P/Invoke. If you really want to learn c# it might be a good idea to convert your c++ dlls/libs over to a c# assembly module (.Net DLL). Taking each section and doing research into how to do it in the c# way.   ;  There are a number of ways you could do this.You could write a wrapper in C++/CLI, giving you a managed assembly that can be used directly from C#. Alternatively, if your code provides a C-style API, you could use P/Invoke (requires some work on the C# side). Failing that, you could also use COM from the C++ side, though this (like P/Invoke) will require some extra work on the C# side.The other way around works too: you can expose and use your .NET objects via COM from within your C++ app.   