I have searched a lot for an answer but could not find one. I have a c++/CLI wrapper that connects between my c# and my c++ code. I would like to pass a pointer to an argument as part as the input parameters of the run function which will express the status of the program.
In c++ I have an enum defined: enum statusCode { INIT,BEGIN, CFG_STARTED, CFG_COMPLETED, STAGE1, STAGE2, DONE}
I have the same enum in my c# code:
public enum statusCode
{
INIT, BEGIN, CFG_STARTED, CFG_COMPLETED, STAGE1, STAGE2, DONE
}
I have a run function in the c++ code that gets the pointer to the status: void Run(statusCode* status);
in the C# side I am using:
public static statusCode program_status = statusCode.INIT;
wrapper.Run(ref program_status);
now in the C++/CLI interface I am stuck...
public ref class Wrapper
{
public:
int run(System::String^ outputDir, statusCode% returnStatus);
}
in the cpp file:
int CMSWrapper::run(statusCode% returnStatus)
{
errorCode ret;
ret = m_Controller->Run( static_cast<statusCode*>(returnStatus));
return ret;
}
I just cant figure out how to declare the Run function and how to describe it in the wrapper (CLI/C++)