News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

BitmapFromResource

Started by ReWolf, May 09, 2005, 08:47:32 AM

Previous topic - Next topic

ReWolf

I've found small bug in this function, when it's calling form executable module, everything is ok, but if we want to use it with DLL containing resources, then we have problem ;)


BitmapFromResource  PROC hModule: dword, ResNumber:DWORD

    ...

    invoke FindResource, NULL, ResNumber, ADDR szImage
    mov hResource, eax
    invoke LoadResource, NULL, eax
    invoke LockResource, eax
    mov hImage, eax
    invoke SizeofResource, NULL, hResource


functions takes hModule, but it's never used ;/ To fix it, just xchange this NULL params with hModule ;)


    invoke FindResource, hModule, ResNumber, ADDR szImage
    mov hResource, eax
    invoke LoadResource, hModule, eax
    invoke LockResource, eax
    mov hImage, eax
    invoke SizeofResource, hModule, hResource