Reputation: 7901
I have created a .netmodule from a C# class library. I am trying to call into a static C# method in the .netmodule from my C++ code. I cannot figure out the syntax (my C++ is weak)to do so. Here is my C# method.
namespace MyModule
{
public static class VersionChecker
{
public static string GetDllVersion()
{
//do some stuff
return version;
}
}
}
I have tried both solutions below...
MyModule::VersionChecker.GetDllVersion();
MyModule::VersionChecker->GetDllVersion();
but I am getting the following error on both lines...
error C2143: syntax error : missing ';' before '.'
Or
error C2143: syntax error : missing ';' before '->'
Can anyone tell me how I can call the static method GetDllVersion
from my C++ code?
Upvotes: 1
Views: 1365
Reputation: 887315
In C++, all references to static members (or types) use ::
:
MyModule::VersionChecker::GetDllVersion();
Upvotes: 7