代码里关于多页TIF文件合并和分解的下面有段代码有个疑问:
Image imgTif(L"G:\\GDItif\\Debug\\tif\\mutitif.tif"); //字符串前的“L”是什么意思?
CString tifPath = GetAppPath(),tifName;
tifPath = tifPath+"\\tif\\mutitif.tif";
Image imgTif(tifPath);
//这里编译就会报:error C2664: '__thiscall Gdiplus::Image::Gdiplus::Image(const unsigned short *,int)' : cannot convert parameter 1 from 'class CString' to 'const unsigned short *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 我想问的是怎样在变量前加上那个“L”啊,
Image imgTif(L(tifPath)); //这样加的话就会报:error C2065: 'L' : undeclared identifier
L为声明的错,我真不知道该怎么解决,就请教大家了……
在线等啊!
Image imgTif(L"G:\\GDItif\\Debug\\tif\\mutitif.tif"); //字符串前的“L”是什么意思?
CString tifPath = GetAppPath(),tifName;
tifPath = tifPath+"\\tif\\mutitif.tif";
Image imgTif(tifPath);
//这里编译就会报:error C2664: '__thiscall Gdiplus::Image::Gdiplus::Image(const unsigned short *,int)' : cannot convert parameter 1 from 'class CString' to 'const unsigned short *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 我想问的是怎样在变量前加上那个“L”啊,
Image imgTif(L(tifPath)); //这样加的话就会报:error C2065: 'L' : undeclared identifier
L为声明的错,我真不知道该怎么解决,就请教大家了……
在线等啊!
解决方案 »
- 很怪的问题,CpropertyPage里面为何不能使用其所长ALT+A热键?(控件caption加&符号)
- 怎么将vector中的一个元素删除,,怎么将vector中的一个值置0
- 新手求助:机器人手臂仿真(vc+opengl) 分全送100
- 关于服务程序
- 各位发表高见:软件开发和软件测试哪个要求更高?哪个更有前途?
- 请求最优解
- 如何让打印居中
- ADO 问题
- asp如何才能察看asp的原码,有多少种方法
- 如何让InstallShield打包成单个EXE可执行文件
- winsocket编程问题,访问外网带路由器主机时,调用gethostbyaddr出错
- vs2008sp1的Office2007界面的最大化bug
CString tifPath = GetAppPath(),tifName;
tifPath = tifPath+"\\tif\\mutitif.tif"; WCHAR wTifName[260] = {0};
MultiByteToWideChar(CP_ACP, 0, tifPath, -1, wTifName, 260);Image imgTif(wTifName);
int num;
WCHAR *wTifName;
num = MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)imagePath, -1, NULL, 0);
wTifName = new WCHAR[num];
MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)imagePath, -1, wTifName, num);
// Image imgTif(L"E:\\GDItif\\Debug\\tif\\mutitif.tif"); Image imgTif(imagePath);
GUID guidtif;
UINT iFrameDimensionsCount = imgTif.GetFrameDimensionsCount();
imgTif.GetFrameDimensionsList(&guidtif,iFrameDimensionsCount);
int totalPage = imgTif.GetFrameCount(&guidtif); //这里的GetFrameCount老是返回0,
不知道为什么,调试也看不出问题,我直接赋上常量就能正常执行,效果也有,我上面转换应该枚问题吧!