Possible Duplicate:
Possible to call C++ code from C#?
I have C++ class, that have some static method. It is in the dll, that exports class. I need to use static method from C# project. Can I do it without COM?
COM would be a good way to do it (other than the fact that COM doesn't support static methods...)
Another way is to turn the class into a C++/CLI managed class like this:
public ref class MyClass
{
public:
static void StaticMethod()
{
...
}
};
A C++/CLI managed class in a DLL will be visible to C# just as if it were a C# class.
If you don't want to turn the C++ project into a C++/CLI project, you can create a C++/CLI project containing a managed class which just wraps the unmanaged class in the unmanaged C++ project.