I am having trouble passing an argument from C ++ / CLI code to .NET C #.
In C ++, I have something similar to the following:
void SomeFunction(short *id)
{
CSharpClass::StaticClassInstance->SetValue(id);
}
On the C # side, the function is declared with the ref argument as:
public void SetValue(ref short id)
{
id = this.internalIdField;
}
The compiler error that I get when calling SetValue (id), "cannot convert parameter 1 from" short * "to" short% ".
I found out that the tracking link (%) is equivalent to C # ref, but I donβt know how to use it with the short * parameter that I am trying to pass.
Thanks in advance.
AndyL source
share