Windows API编程怎么在dll中获取动态链接库的句柄?
因为我想用HBITMAPLoadBitmap(HINSTANCEhInstance,LPCTSTRlpBitmapName)函数在动态链接库中加载一幅位图,但第一个参数要...
因为我想用HBITMAP LoadBitmap(HINSTANCE hInstance, LPCTSTR lpBitmapName)函数在动态链接库中加载一幅位图,但第一个参数要传入一个句柄。
或者有人告诉我怎么在动态链接库中显示一幅位图,请高手不吝赐教,回答好有追加分!
LoadLibrary的话可以加载自身吗?
可我用的是API编程,没用MFC编程啊!!! 展开
或者有人告诉我怎么在动态链接库中显示一幅位图,请高手不吝赐教,回答好有追加分!
LoadLibrary的话可以加载自身吗?
可我用的是API编程,没用MFC编程啊!!! 展开
5个回答
展开全部
动态链接库的话,可以用 LoadLibrary 载入
返回的就是需要的句柄
返回的就是需要的句柄
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
LoadBitmap
The LoadBitmap function loads the specified bitmap resource from a module's executable file. This function has been superseded by theLoadImage function.
HBITMAP LoadBitmap(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpBitmapName // address of bitmap resource name
);
Parameters
hInstance
Handle to the instance of the module whose executable file contains the bitmap to be loaded.
lpBitmapName
Pointer to a null-terminated string that contains the name of the bitmap resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. TheMAKEINTRESOURCE macro can be used to create this value.
Return Values
If the function succeeds, the return value is the handle to the specified bitmap.
If the function fails, the return value is NULL.
这个函数说明,应该说得很明白了吧。
The LoadBitmap function loads the specified bitmap resource from a module's executable file. This function has been superseded by theLoadImage function.
HBITMAP LoadBitmap(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpBitmapName // address of bitmap resource name
);
Parameters
hInstance
Handle to the instance of the module whose executable file contains the bitmap to be loaded.
lpBitmapName
Pointer to a null-terminated string that contains the name of the bitmap resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. TheMAKEINTRESOURCE macro can be used to create this value.
Return Values
If the function succeeds, the return value is the handle to the specified bitmap.
If the function fails, the return value is NULL.
这个函数说明,应该说得很明白了吧。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你没注意到DllMain有个参数很可疑么?
谁跟你说过DllMain是MFC得了...?
谁跟你说过DllMain是MFC得了...?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我猜,既然是动态链接库,那么一定有一个宿主,应该有获得宿主应用程序句柄的方式,要么就直接传NULL试试,我记不太清楚了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询