开发者

How to change string of ^ type to char* type in vc++ CLR window application?

I'm working on a vc++ CLR window 开发者_JAVA技巧application.In this application when I browse the local file system for file selection, the input file path is coming in string^ type ...now I want to change this ^ type to char* type. Help me. Thank you.


You probably want Marshal::StringToHGlobalAnsi

IntPtr p = Marshal::StringToHGlobalAnsi(managedString);
char* c = (char*)p.ToPointer();
...
Marshal::FreeHGlobal(p);

See msdn for more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜