从TCHAR *转换为c ++中的字符串 [英] Conversion from TCHAR* to string in c++

查看:76
本文介绍了从TCHAR *转换为c ++中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在CLR接口中使用api getprivateprofilestring的输出,它接受String ^。

getprivateprofilestring的输出存储在TCHAR *中。

任何可能的转换。我已经从字符串转换为字符串^。

因此任何指针都可以将TCHAR *转换为字符串。



真的卡住了在这。



任何帮助都是奖金。

I have to use the output of the api getprivateprofilestring in the CLR interface which takes String^.
The output of getprivateprofilestring am storing in TCHAR*.
Any possible conversion. I have got the conversion from string to String^.
So any pointer so that TCHAR* can be converted to string.

Really stuck in this.

Any help will be a bonus.

推荐答案

你可以创建 std :: string std :: wstring 来自 TCHAR * 所以剩下的应该是很容易。
You can create a std::string or std::wstring from a TCHAR* so the rest should be easy.


这篇关于从TCHAR *转换为c ++中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆