LoadIcon, LoadCursor

Windows specific questions.
Post Reply
rdc
Posts: 1741
Joined: May 27, 2005 17:22
Location: Texas, USA
Contact:

LoadIcon, LoadCursor

Post by rdc »

I didn't see this mentioned anywhere, and I found it out through a bit of trial and error. This no longer works:

Code: Select all

        .hIcon         = LoadIcon( null, IDI_APPLICATION )
        .hCursor       = LoadCursor( null, IDC_ARROW )
I looked at the include file and it appears that Load* takes a string. So I tried:

Code: Select all

        .hIcon         = LoadIcon( null, IDI_"")
        .hCursor       = LoadCursor( null, "" )
And this seems to work.

My question is, what if you want to load a diifferent stock icon or cursor?
v1ctor
Site Admin
Posts: 3804
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Post by v1ctor »

You have to use the BYVAL modifier now, it was added to make byval string params more safe, as they can be used in FB functions too since 0.13. If a user had by mistake "declare sub foo( byval bar as string): foo 1234" it was accepted before, now, to support the M$ Win API quirks that allow pointers and literals others than NULL to be passed to pointer arguments, the BYVAL modifier has to be used to keep the compiler quiet.
Post Reply