error C2664: 'FromFile' : cannot convert parameter 1 from 'class CString' to 'const unsigned short *
代码
CFileDialog openDlg(true);
m_Bitmap_org = Bitmap::FromFile(openDlg.GetPathName());
用来动态打开文件,为啥会出现
error C2664: 'FromFile' : cannot convert parameter 1 from 'class CString' to 'const unsigned short *
这样的问题
CFileDialog openDlg(true);
m_Bitmap_org = Bitmap::FromFile(openDlg.GetPathName());
用来动态打开文件,为啥会出现
error C2664: 'FromFile' : cannot convert parameter 1 from 'class CString' to 'const unsigned short *
这样的问题
解决方案 »
- VC中怎样用代码打开压缩文件啊?
- lock-free CAS InterlockedCompareExchange volatile 疑问讨论
- 错误如何解决。
- AfxAppendFilterSuffix(strFilter, dlgFile.m_ofn, pTemplate, &strDefault);.
- 想学线程编程,从哪里学起,还有推荐下相关的学习资料。顶者有分.
- 内存不能读,请指教,谢谢!
- 指针问题,一直没明白
- 请问高手,如何去掉控件的3D属性啊~
- 【求助】dll2lib 带来的奇怪的"R6030 CRT Not Initialized"
- 谁能帮我按提供的源码资料编个程序!
- MessageBox 问题
- 怎样用vc启动autocad并画一条直线
const WCHAR *filename,
BOOL useEmbeddedColorManagement
);Parameters filename
[in] Pointer to a null-terminated string that specifies the path name of the image file.
useEmbeddedColorManagement
[in] Optional. Boolean value that specifies whether the new Bitmap object applies color correction according to color management information that is embedded in the image file. Embedded information can include International Color Consortium (ICC) profiles, gamma values, and chromaticity information. TRUE specifies that color correction is enabled, and FALSE specifies that color correction is not enabled. The default value is FALSE. Return Value This method returns a pointer to the new Bitmap object.
用GetBuffer(...);m_Bitmap_org = Bitmap::FromFile(openDlg.GetPathName().GetBuffer(0) );
error C2664: 'FromFile' : cannot convert parameter 1 from 'char *' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.…………