www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Resource loading error

reply Gilles G. <schaouette free.fr> writes:
Hello,
I am trying to use some resources for a program using the windows API.
For instance, I just try to load an image.
the resource file test.rc looks like:
   1   BITMAP "logo.bmp"
I compile this resource file using rcc.exe test.rc, this create test.res
Then I try to use the resource in my program (test.d) like this:
    ghBmp = LoadBitmapA(ghWndMain, MAKEINTRESOURCEA(1));
    assert(ghBmp);
(I compile using dmd -oftest test.res test.d)
But I always got an assert error at run time.

Do you have any idea?
--
Gilles
Jul 12 2007
parent "Chris Miller" <chris dprogramming.com> writes:
On Thu, 12 Jul 2007 04:41:49 -0400, Gilles G. <schaouette free.fr> wrote=
:

 Hello,
 I am trying to use some resources for a program using the windows API.=

 For instance, I just try to load an image.
 the resource file test.rc looks like:
    1   BITMAP "logo.bmp"
 I compile this resource file using rcc.exe test.rc, this create test.r=

 Then I try to use the resource in my program (test.d) like this:
     ghBmp =3D LoadBitmapA(ghWndMain, MAKEINTRESOURCEA(1));
     assert(ghBmp);
 (I compile using dmd -oftest test.res test.d)
 But I always got an assert error at run time.

 Do you have any idea?
 --
 Gilles

Try with the -32 switch. I think Digital Mars' rcc has problems with som= e = types of bitmaps.
Jul 23 2007