在Visual C++ 2003开发环境中用ATL项目向导生成的程序中用哪个函数可以获得资源句柄

解决方案 »

  1.   

    你要获得什么资源,字符串 用loadstring
    图像用loadbitmap
      

  2.   

    我想加载一张位图,用LoadBitmap函数或LoadImage函数均可,但是第一个参数资源句柄我不知道如何填
      

  3.   

    以前VC6.0用CComModule对象_Module的GetResourceInstance函数可以,现在VC2003就不知道怎么用了。CAtlModule类也有个GetResourceInstance()函数,但不知道怎么调用
      

  4.   

    终于把问题解决了,参考了MSDN中
    An instance of CAtlBaseModule named _AtlBaseModule is present in every ATL project, containing a handle to the module instance, a handle to the module containing resources (which by default, are one and the same), and an array of handles to modules providing primary resources. CAtlBaseModule can be safely accessed from multiple threads.
    在程序中直接用对象_AtlBaseModule就行