How do I use LoadImage?

B

B

I have the following code inside my COM addin in C++ that adds a couple
of menu buttons to Microsoft Outlook:

HBITMAP hBmp =(HBITMAP)::LoadImage(param1,param2,IMAGE_BITMAP,
0, 0,LR_LOADMAP3DCOLORS);

::OpenClipboard(NULL);
::EmptyClipboard();
::SetClipboardData(CF_BITMAP, (HANDLE)hBmp);
::CloseClipboard();
::DeleteObject(hBmp);

cmdBarButton->put_Style(Office::msoButtonIconAndCaption);
cmdBarButton->PasteFace();

I want to load a bmp named say "myPic.bmp" to my menu button.

1) Do I have to add this bmp into the resource files of my project ?
2) What should the parameters to the function(param1 and param2 above)
be?
3) In some examples I came across param1 =
_Module.GetResourceInstance() . What does this imply?
4) What exactly is param2 ? Is it the name of the image to be loaded ?

Please help me out. Code snippets would be of great help.

Thanks,
B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top