能不能仅仅包一个GDI+的库,而不用MFC?毕竟MFC库有点大的说。

解决方案 »

  1.   

    MFC库里本身没有GDI+的,NET库里有
    GDI+的库就一个DLL 网上可以下载
      

  2.   

    GDI+
    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.
      

  3.   

    楼主,使用GDI+,强烈推荐使用.net(虽然也强烈反对!~_~|||)
      

  4.   

    我就是用VC的向导新建了一个Win32工程(VC2003),然后在stdafx.h文件里的末尾加了这两句,
    #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)
      

  5.   

    我不太喜欢用C#,用C++习惯了,用了好几年了,主要是用着STL爽啊,哈哈。
      

  6.   

    e:\download\mfcgdiplus\GDIPlus\这个是你的工程路径?
      

  7.   

    MFC用得实在是不爽,好几个项目都用mfc做的,深恶痛绝之。
      

  8.   

    不是啊,那只是GDIPlus库所在的路径
      

  9.   

    不是啊,那只是GDIPlus库所在的路径
    _______________________装Platfrom SDK。
      

  10.   

    在工程路径设置中要把gdi+的头文件路径放在vc默认安装路径的上面
      

  11.   

    我就是这么设的啊,gdi+的路径我都设到最上面了。
    不是这个原因。
      

  12.   

    为什么要装Platform sdk?不懂!
    安装vs的时候不是已经装了吗?
      

  13.   

    我刚开始没有使用下载的gdi+库,编译不过。
    后来下了个gdi+的库,带include,lib的,然后把下载的这个gdi+的路径设到最上面,
    结果一样。
      

  14.   

    去下2003年2月的SDK
    最新的SDK不支持VC6.0
      

  15.   

    我装的是VS2003,安装的是自带的Platform SDK.
      

  16.   

    vs2003自带Platform SDK,GDI+也包含在内。
    你的错误是缺乏COM相关的定义,加一个头文件在前面就可以了。
    #include <comdef.h>
    #include <gdiplus.h>
      

  17.   

    果然如是,楼上高人,少include了comdef.h这个文件,GDI+需要一些COM定义。
      

  18.   

    Analyst 太厉害了
    这个问题我搞了一天了也没搞出来,幸亏你老的指点阿。
    请教一下,你是怎么知道的啊?教小弟一点方法阿。
    小弟初学VC++.Net,经常碰到类似的问题啊。
    有什么好的建议不?
      

  19.   

    还有一种解决方法就是在<stdafx.h>头文件中注释掉:
       #define WIN32_LEAN_AND_MEAN // 从 Windows 头中排除极少使用的资料即
    //#define WIN32_LEAN_AND_MEAN // 从 Windows 头中排除极少使用的资料就可以解决。
      

  20.   

    就是预定义 #define WIN32_LEAN_AND_MEAN
    将comdef.h屏蔽掉了