The line of code i need to translate from C++ to C#:
void GetAnalysisModeName( ON_wString& name ) const;
I’ve tried with:
public override void GetAnalysisModeName(string name){}
But it tells me that the return type has to be a string.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A straight conversion would be:
But it looks like you’re also trying to override something inside of the C# class.
Judging by the message that the return type must be a string, I’d say that the signature of the method you are overriding and the signature of the C++ method you posted don’t match.
EDIT
This is actually a mis-understanding. I double checked the Rhino APIs. You’re using the .NET SDK. Your C++ example uses the C++ SDK. The two SDKs have different signatures. For you to properly override the .NET version, you need:
I suggest you download the .NET SDK Documentation for Rhino so that you have it as a reference. It will also give you a brief description of what the method is supposed to do when implemented.