06302225.txt 30-Jun-00


Subject: Get bitmap resource from DLL
From: "Mike Bertenshaw" <mikebertenshaw@ais-lims.com>

Can anyone suggest how I can get a pointer to a bitmap
  resource ID in a DLL for use in the
  ShellWithCentredBitMap() method in the MdiClient
  application given on both CA Open Forums and Paul Piko's
  web site.  The context is as follows:
Method ShellWithCentredBitMap() Class MyShellWindow
  LOCAL hWnd AS Ptr
  hWnd := Self:Handle(4)
  // Set up the replacement WndProc for the shell
  SubClassWindow(  hWnd, @MdiClientWinProc() )
  // Load our bitmap
  Self:hBkGndBitMap := LoadBitmap( _GetInst(), ;
    String2Psz( "BkGndBitMap") )
  // I want to replace String2Psz( "BkGndBitMap")
  // with a poiinter to a resource in a DLL
  // DeleteObject is called in our close
  // Send the following message to set up the
  MdiClientWndProc
  SendMessage( hWnd, WM_USER + 4, 0, ;
    Long( _Cast, Self:hBkGndBitMap ) )
  InvalidateRect( hWnd, NULL_PTR, TRUE )
RETU Self


Subject: Re: Get bitmap resource from DLL
From: "Stephane Hebert" <stephhebert@mypants~videotron.ca>

Mike,

Checkout the LoadImage() function

Stephane Hebert


Subject: Re: Get bitmap resource from DLL
From: "Mike Bertenshaw" <mikebertenshaw@ais-lims.com>

Stephane,

Thanks for your suggestion. I checked out LoadImage(), but
  see my message.to Geoff.  I'm still trying to work out
  what happens if I remove your pants though!!!

Mike


Subject: Re: Get bitmap resource from DLL
From: "Geoff Schaller" <geoffsch@bigpond.net.au>

Mike,

Replace _GetInst() with
  GetModuleHandle(Cast2Psz("MyDll.dll"))
Make sure that earlier in the app you called:
LoadLibrary("GCSImages.dll")
You don't need dummy functions or anything else if all you

  want are resource strings and this approach can be used
  with system dlls or any. Just specify the full path to the
  dll if it is not in the normal search path.

Geoff

(PS - take a look at my canvas.exe on KnowVO. It shows you a
  couple of other options for your background in a simple
  demo)


Subject: Re: Get bitmap resource from DLL
From: "Mike Bertenshaw" <mikebertenshaw@ais-lims.com>

Geoff,

GetModuleHandle(Cast2Psz("MyDll.dll")) is just what I
  needed.  I'll also check out your Canvas.exe.

Thanks,
Mike
