我的mfc代码无法在窗口8上运行 [英] my mfc code not working on window 8

查看:86
本文介绍了我的mfc代码无法在窗口8上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





此代码在窗口XP上工作正常但在窗口8上工作不正常并且项目设置字符==使用多字节字符集然后UNICODE请建议紧急解决方案



hi

this code working fine on window XP but on window 8 not working and project setting character ==Use Multi-Byte Character Set other then UNICODE please suggest the solution its urgent

Cstring FolerPath;
Bitmap bmp;

int nLen = FolerPath.GetLength() + 1;
WCHAR* pwsz = new WCHAR [nLen];   
mbstowcs (pwsz,FolerPath,nLen);
CLSID encoderClsid;
GetEncoderClsid(L"image/bmp",&encoderClsid);		
bmp.Save(pwsz,&encoderClsid,NULL);				
delete pwsz;	




在窗口8上保存位图= win32Error时出现
错误



error on saving bitmap =win32Error on window 8

推荐答案

它不清楚FolderPath是编译为CStingA(类型char)还是CStringW(类型为wchar_t)。 CSting是一个宏,它产生CStingA或CStringW类型。如果定义了_UNICODE和UNICODE,则使用CStringW。
It is not clear if FolderPath is compiled as CStingA (type char) or CStringW (type wchar_t). CSting is a macro which result in the types CStingA or CStringW. CStringW is used if _UNICODE and UNICODE is defined.


这篇关于我的mfc代码无法在窗口8上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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