能不能仅仅包一个GDI+的库,而不用MFC?毕竟MFC库有点大的说。
解决方案 »
- VC2008 多文档 打印预览如何实现跟vc6.0中一样?
- 关于输入法DLL需要include的头文件
- 请教大家一个数学问题:怎样求解任意曲线围成区域的面积(内部没有孔,而且只知道曲线的几个拟合点的坐标)?
- CTreeCtrl的节点只能显示/编辑270个字符,怎么突破?
- 全局钩子,当应用程序为活动窗口时可以钩到键盘消息,如果不是当前活动应用程序则不行,为什么?
- Essential c++ 中的一个小例子
- mfc中基于VC编程复制文件夹怎么计算最后的平均拷贝速度?
- 请问如何设置字体(73分!!!!!!!!!!!!!!!!!!!!!!!)
- vc调试获取变量
- 想作个停车场自动化管理系统。有个问题,如何判断进去的车子和出来的车子是同一辆?用摄像头抓拍照片,然后比较照片?怎么比较?
- 那位大哥有<Visual C++ 6.0 数据库高级编程>的源代码,能给我发一份吗,谢谢了
- 问一个用access导入文本文件的问题,应该不是很难
GDI+的库就一个DLL 网上可以下载
PurposeMicrosoft Windows GDI+ is a class-based application programming interface (API) for C/C++ programmers. It enables applications to use graphics and formatted text on both the video display and the printer. Applications based on the Microsoft Win32 API do not access graphics hardware directly. Instead, GDI+ interacts with device drivers on behalf of applications. GDI+ is also supported by Microsoft Win64.
Where ApplicableGDI+ can be used in all Windows-based applications. GDI+ is new technology that is included in Windows XP and the Windows Server 2003. It is required as a redistributable for applications that run on the Microsoft Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Millennium Edition (Windows Me) operating systems.
Developer AudienceThe GDI+ C++ class-based interface is designed for use by C/C++ programmers. Familiarity with the Windows graphical user interface and message-driven architecture is required.
#include <GdiPlus.h>
#pragma comment( lib, "gdiplus.lib" )
然后增加了GDI+的inlude路径和lib路径
然后编译,报了一堆错误。
我找了很多网上的资料大多都是介绍这么用的啊,
难道我用错了吗?还请大家指教。编译错误如下:
e:\download\mfcgdiplus\GDIPlus\Includes\GdiPlusImaging.h(80) : error C2501: 'MIDL_INTERFACE' : missing storage-class or type specifiers
e:\download\mfcgdiplus\GDIPlus\Includes\GdiPlusImaging.h(80) : error C2440: 'initializing' : cannot convert from 'const char [37]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
e:\download\mfcgdiplus\GDIPlus\Includes\GdiPlusImaging.h(80) : error C2146: syntax error : missing ';' before identifier 'IImageBytes'
e:\download\mfcgdiplus\GDIPlus\Includes\GdiPlusImaging.h(80) : error C2470: 'IImageBytes' : looks like a function definition, but there is no formal parameter list; skipping apparent body
e:\download\mfcgdiplus\GDIPlus\Includes\GdiPlusImaging.h(80) : error C2059: syntax error : 'public'
e:\download\mfcgdiplus\GDIPlus\Includes\GdiPlusImaging.h(259) : error C2146: syntax error : missing ';' before identifier 'id'
e:\download\mfcgdiplus\GDIPlus\Includes\GdiPlusImaging.h(259) : error C2501: 'Gdiplus::PropertyItem::PROPID' : missing storage-class or type specifiers
...
102(errors)
_______________________装Platfrom SDK。
不是这个原因。
安装vs的时候不是已经装了吗?
后来下了个gdi+的库,带include,lib的,然后把下载的这个gdi+的路径设到最上面,
结果一样。
最新的SDK不支持VC6.0
你的错误是缺乏COM相关的定义,加一个头文件在前面就可以了。
#include <comdef.h>
#include <gdiplus.h>
这个问题我搞了一天了也没搞出来,幸亏你老的指点阿。
请教一下,你是怎么知道的啊?教小弟一点方法阿。
小弟初学VC++.Net,经常碰到类似的问题啊。
有什么好的建议不?
#define WIN32_LEAN_AND_MEAN // 从 Windows 头中排除极少使用的资料即
//#define WIN32_LEAN_AND_MEAN // 从 Windows 头中排除极少使用的资料就可以解决。
将comdef.h屏蔽掉了