各位高手在win32 sdk为主体框架的程序中能否使用mfc的类哪?能否使用为mfc程序写的动态连接库之类的先成的程序代码啊?如果能清告诉我,用什么方法,最好附上例程原码.我想利用一个imageload.dll来读去gif jpeg图像,可是这个东东是为mfc程序设计的,我该怎么利用啊,imageload.dll说明如下:
有网友正在找支持JPEG,GIF等图象格式的源代码,刀客手头的确有一些,不过仅作交流之用,请不要用于其他用途。
这里我先放一个不错的东东供大家参考
要使用这个源码你必须下载以下几个部件
1.链接库(包括imageload.lib,imageobject.lib,imageobjectd.lib和imageload.dll)
点击此处下载(147k) 2.头文件(imageobject.h和imageload.h) 
点击此处下载(2.1k)使用说明:
1.在你的视图类的头文件中加入:
#include "ImageObject.h"2.在类中加入变量说明:
public:
CImageObject *m_pImageObject构造函数中: 
m_pImageObject=NULL
析构函数中:
if(m_pImageObject!=NULL)
delete m_pImageObject;3.在ondraw函数中:
m_pImageObject=new CImageObject("test.jpg",pDC);//把"test.bmp"改成你要打开的文件
if(m_pImageObject!=NULL){
m_pImageObject->SetPalette(pDC);
m_pImageObject->Draw(pDC); 
}
4.在visual studio菜单中的project-->settings的link标签页中设置object/library modules
发行版(release):imageload.lib imageobject.lib
调试版 (debug):imageload.lib imageobjectD.lib
要使编译器找到这些库,你可以在菜单中点tools->options ,在弹出的对话框中选directories标签页, 设置"lib"的路径
5.编译得到的文件运行时需要imageload.dll,请把imageload.dll放到windows目录下或把它和可执行文件放在一个路径下。
6.CImageLoad类还有很多功能如 stretch(拉伸),rotate(旋转)等,自己看吧。

解决方案 »

  1.   

    yes, you can use MFC in sdk program
    #include <afxwin.h>
    #include <afxtempl.h>
    void main()
    {
    AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0);
    CMap<int, int, CString, CString> m_cMap;m_cMap.SetAt(9923033,  "张三");
    m_cMap.SetAt(9826033,  "张A");
    m_cMap.SetAt(9923063,  "张B");
    m_cMap.SetAt(9923093,  "张C");CString strName;
    m_cMap.Lookup(9923063, strName);
    AfxMessageBox(strName);
    }
      

  2.   

    It sounds a little complexity ...
      

  3.   

    看需要什么.h文件,或者再拷贝stdafx.h中的#include 算了,
    不就可以了
      

  4.   

    谢谢大家的提示,我是个新手啊,明白了一些,我要用的那个imageload.dll怎么用啊,有关于我这个问题方面的文章或书籍下载吗?清多多帮忙 (*^_^*)
      

  5.   

    If you're going to develop applications for Windows, you've got to choose a development environment. Assuming that you've already rejected non-C options such as Microsoft Visual Basic and Borland Delphi, here are some of your remaining options: 
    Program in C with the Win32 API
    Write your own C++ Windows class library that uses Win32
    Use the MFC application framework
    Use another Windows-based application framework such as Borland's Object Windows Library (OWL)If you're starting from scratch, any option involves a big learning curve. If you're already a Win16 or Win32 programmer, you'll still have a learning curve with the MFC library. Since its release, MFC has become the dominant Windows class library. But even if you're familiar with it, it's still a good idea to step through the features of this programming choice. The MFC library is the C++ Microsoft Windows API. If you accept the premise that the C++ language is now the standard for serious application development, you'd have to say that it's natural for Windows to have a C++ programming interface. What better interface is there than the one produced by Microsoft, creator of Windows? That interface is the MFC library. Application framework applications use a standard structure. Any programmer starting on a large project develops some kind of structure for the code. The problem is that each programmer's structure is different, and it's difficult for a new team member to learn the structure and conform to it. The MFC library application framework includes its own application structure—one that's been proven in many software environments and in many projects. If you write a program for Windows that uses the MFC library, you can safely retire to a Caribbean island, knowing that your minions can easily maintain and enhance your code back home. Don't think that the MFC library's structure makes your programs inflexible. With the MFC library, your program can call Win32 functions at any time, so you can take maximum advantage of Windows. 
      

  6.   

    再SDK框架程序里用MFC,要加上相应的头文件和----多线程C运行库动态连接库只要不是MFC扩展DLL就可以在SDK里使用
      

  7.   

    谢谢 qing_li73(bluemoon)的建议,勉强看懂了你的意见,mfc是趋势.有利与发展.但是我怎么觉得sdk的书籍通俗易懂啊!你在国外吧!英文顶瓜瓜啊!多联系,多帮助我!放分!!!!!!!!!!!保留20分等待更好的帮助!!!!!!!!!!!!!!
      

  8.   

    llwwwww([email protected])那个imageload.dll是mfc扩展的dll吗?
      

  9.   

    既然是dll,那应该是个通用的接口,难道SDK就不能用吗?!
    用LoadLibrary函数可以吗?
      

  10.   

    什么叫mfc扩展的dll,有哪位可以解释一下吗?!
    大家都能学习学习
      

  11.   

    完全可以使用win32 sdk 与mfc的类混合编程。
    只不过要你手工配置一些编译链接的参数。
    而且使用某些交互式的控件要麻烦一点,不像在mfc环境里那样方便。
      

  12.   

    可以
    ================================================================CSDN 论坛助手 Ver 1.0 B0402提供下载。 改进了很多,功能完备!★  浏览帖子速度极快![建议系统使用ie5.5以上]。 ★  多种帖子实现界面。 
    ★  保存帖子到本地[html格式]★  监视您关注帖子的回复更新。
    ★  可以直接发贴、回复帖子★  采用XML接口,可以一次性显示4页帖子,同时支持自定义每次显示帖子数量。可以浏览历史记录! 
    ★  支持在线检测程序升级情况,可及时获得程序更新的信息。★★ 签名  ●  
         可以在您的每个帖子的后面自动加上一个自己设计的签名哟。Http://www.ChinaOK.net/csdn/csdn.zip
    Http://www.ChinaOK.net/csdn/csdn.rar
    Http://www.ChinaOK.net/csdn/csdn.exe    [自解压]