I want to conver a tchar* to char * is this possible . if yes how to do it. I use unicode setting
相关问题
- how to call a C++ dll from C# windows application
- efficiently calling unmanaged method taking unmana
- Why is my COM factory never released during the pr
- Create CFrameWnd gives first-chance exceptions--wh
- Underline is drawn outside of rectangle reported b
相关文章
- C++: Callback typedefs with __stdcall in MSVC
- Is it possible to check whether you are building f
- Which VC++ redistributable package to choose (x86
- MFC CListView响应HDN_ITEMCHANGING后改变列宽无法自动显示隐藏水平滚动条
- How can I handle the Return key in a CEdit control
- How can I create a guid in MFC
- How to convert Byte Array to hex string in visual
- Visual Studio unable to recognise my MFC library f
I find wcstombs works great for doing this sort of thing,
You can't convert the pointer, you need to allocate a new string that is "char" instead of "wchar_t"
the most elegant way to do this is with the ATL conversion macros because it will hide all the allocation and called to the functions mentioned in the other comments
example
A
TCHAR
is either a plainchar
or awchar_t
depending on your project's settings. If it's the latter, you would need to useWideCharToMultiByte
with appropriate code page parameter.