我程序在VS2005里Release和Debug下运行很正常,但运行Release生成的exe却加载不到图片(图片在资源里),Debug生成的exe也是正常的,观察项目Release和Debug下属性的设置好象没什么区别。

解决方案 »

  1.   

    (HBITMAP)::LoadImage(hInstance, MAKEINTRESOURCE(IDB_BITMAP3), IMAGE_BITMAP, 256, 128, 0);图片显示不了;但是直接在VS里运行时可以的
      

  2.   

    晕~我把项目属性里Configuration Properties -> c/c++ -> Code Generation -> Runtime Library 的值 Multi-threaded (/MT)换成Multi-threaded DLL (/MD)就好了,不知道为什么!!
      

  3.   

    拷贝自 蒋晟的专栏
    用VS2005如何生成本地代码(VC/MFC 基础类)我在VS2005中建立了一个WIN32 CONSOLE项目,在项目设置中明确的关闭了CLR,但这时生成的应用程序在没有安装。NET 2.0的机器上无法运行。请问如何生成本地代码?
    No you do not need the .NET FX 2.0 to run the win32 console app, if you are not using any managed C++/CLI stuff.What you do need is probably the CRT (msvcr80.dll and msvcp80.dll) if you are using dynamic CRT DLLs instead of static in your project settings.If you change to static libraries in your project settings then you do not need those either.To change to use the static libraries, just go under:Project - Properties - Configuration Properties - C/C++ - Code Generationand for release settings change from:Multi-threaded DLL (/MD)to:Multi-threaded (/MT)and for debug settings change from:Multi-threaded Debug DLL (/MDd)to:Multi-threaded Debug (/MTd)reference
    http://www.codeproject.com/cpp/vcredists_x86.asphttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=157129&SiteID=1
      

  4.   

    MFC程序就是这样的,这个网上有很多资料,很多人都范过这种错误
      

  5.   

    Maybe it's due to VS2005, the IDE still has many bugs to fix even after SP1 is released.
    I like MS's products, but VS2005 seems to have depressed many...