开发者

How do I convert a *char to _TCHAR?

开发者 https://www.devze.com 2023-01-27 09:23 出处:网络
This is what I tried but it didn\'t do anything. Mult开发者_如何学GoiByteToWideChar(CP_ACP, MB_COMPOSITE, optarg, -1, localdir, 0);

This is what I tried but it didn't do anything.

Mult开发者_如何学GoiByteToWideChar(CP_ACP, MB_COMPOSITE, optarg, -1, localdir, 0);


in the start of the function add: "USES_CONVERSION;" and it allows you to use the macros: "A2T", "T2A" ... so you need A2T enjoy


Actually you can use many way: 1. wstreamstring << szYourCharStar;

  1. _bstr_t bstr = szYourCharStar;

Those way can minumize your effort of resource management, if you use other way, you might need to free up the resource.

For instance:

_com_util::Convert_To_WCHAR ?? forget the name.

0

精彩评论

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