I've got a code snippet of c# that I've been trying to translate into vc++, but I'm having some difficulties. So, I'm wondering if it is possible or advisable to mix c# and vc++; that is to say, can I call my c# function from vc++ and vice-versa. If so, are there tricks to it? If, not, why?
If you want to mix the two, I'd start with C# as the base project and then register an unmanaged (C++) DLL in your C# project. That way you can combine the reliability of the managed C# parent application with the speed benefits of C++ in any processor-intensive methods you might have.
Is the VC++ app managed? If so, you could create a C# DLL, use it from your c++ app, and if you so desire, ILMerge them into a single EXE.
Calling C++ code from C# is easy enough and you should be able to find plenty of articles on Pinvoke and other types of interop.
For calling your C# code from C++ - if your C++ app is managed then you should be able to directly reference the C# assembly from your C++ app and use it as normal.
If ypu C++ code is not managed then you will need to use some sort of interop to allow your C++ assembly to call C# code, the only way of doing this that springs to mind is COM.
Try some of these links for more information on COM interop with C#: