I generate C++/CLI code via System.CodeDom of .NET.
Recently, I had to create a C++/CLI method with a pointer, like int foo(char *data) , which turned out tricky.
System.CodeDom.CodeParameterDeclarationExpression(type, name) creates parameters with handles(^) only, not poiters(*) and I can’t find a way to do it.
How could it be done? Any clue is appreciated.
Finally, I decide to use programmatically remove asterisk from the type, create CodeTypeReference for the type without asterisk and create variable with name, starting from the asterisk.
Another way is to create “ForceTypePassThrough” key for UserData dictionary of the type as follows:
This ways work.