[Migrated content. Thread originally posted on 24 November 2010]
I don't want to distribute bitmaps with my application, and if I add bitmaps to buttons, forms, etc. then I don't have to. However, I have a couple of bitmaps I want to use on active-x components so I need to load them with the CALL "W$BITMAP" USING WBITMAP-LOAD-PICTURE routine. The following code works 100% and I have access to the images when using acuthin.exe, but does not work when run with wrun32.exe it falls into the WBERR-FILE-ERROR. Is there something I need to do differently when run under wrun32 or could this just be a bug that I need to report?
COPY RESOURCE "MyPic.bmp".
77 IMAGE-HANDLE HANDLE OF IPictureDisp.
77 IMAGE-ERROR REDEFINES IMAGE-HANDLE PIC S9(9) COMP-5.
CALL "W$BITMAP" USING WBITMAP-LOAD-PICTURE, "MyPic.bmp"
GIVING IMAGE-HANDLE.
EVALUATE IMAGE-ERROR
WHEN WBERR-FILE-ERROR
DISPLAY MESSAGE BOX
"File not found"
TITLE "Error"
INITIALIZE IMAGE-HANDLE
WHEN WBERR-FORMAT-UNSUPPORTED
DISPLAY MESSAGE BOX
"Format not supported"
TITLE "Error"
INITIALIZE IMAGE-HANDLE
WHEN OTHER
DISPLAY MESSAGE BOX
"File successfully loaded"
TITLE "Success"
END-EVALUATE.



