May 08, 2024, 10:12:35 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Loading Image From External DLL

Started by Zen, July 15, 2006, 08:39:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zen

Ok, so i know how to load a bitmap from a resource from the calling application using CBitmap::LoadFromResource() but if i am manually using LoadLibraryA, then find the resource etc, how do i then use it within aurora's GUI classes to display it in my application?

Lewis

Ionic Wind Support Team

use the Attach member function on a handle.

Probably the simplest way is to use LoadBitmap

DECLARE import, LoadBitmapA(
  UINT hInstance,  // handle to application instance
  string lpBitmapName  // name of bitmap resource
),UINT;

hInstance is the handle to the DLL returned by LoadLibraryA.  LoadBitmapA returns a handle to the bitmap so..

CBitmap b;
b.Attach(hBitmap);

Would be all that would be needed.
Ionic Wind Support Team

Zen

Ahhh i looked at that but i assumed it was a private method used by the other methods, obviously thinking about it, you always comment which methods and members are private or public. Silly me.

Thanks a lot Paul
Lewis