DC_IconDefault()

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

DC_IconDefault()

#1 Post by unixkd »

Hi Roger

It appears that DC_IconDefault( [<nIcon>] ) only works with resource file linked to the .EXEcutable program.

My application resource file is a .DLL loaded with the DC_BitmapResourceFile( {DllLoad('PPSRES.DLL')} ). How can this be achieved.

Thanks.

Joe

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: DC_IconDefault()

#2 Post by Auge_Ohr »

unixkd wrote:It appears that DC_IconDefault( [<nIcon>] ) only works with resource file linked to the .EXEcutable program.

My application resource file is a .DLL loaded with the DC_BitmapResourceFile( {DllLoad('PPSRES.DLL')} ). How can this be achieved.
have a look into Source c:\exp19\Source\Dclipx\_dcmsg.prg

Code: Select all

FUNCTION DC_IconDefault( nIcon )
STATIC snIcon := nil
LOCAL nOldIcon := snIcon
snIcon := IIF(Valtype(nIcon)='N',nIcon,snIcon )
RETURN nOldIcon
it does not "load" any Icon
greetings by OHR
Jimmy

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DC_IconDefault()

#3 Post by unixkd »

Thanks.

How can I set a default ICON for my application. All forms/dialogs will have this ICON.

Joe

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_IconDefault()

#4 Post by rdonnay »

You are looking at some old code.
I updated this a few builds back.
I don't recall which. This now accepts an XbpIcon object.

Try this:

oIcon := DC_GetBitmap( <nIconRes> )

DC_IconDefault(oIcon)

Code: Select all

FUNCTION DC_IconDefault( noIcon )

STATIC snoIcon := nil

LOCAL noOldIcon := snoIcon

snoIcon := IIF(Valtype(noIcon)$'NO',noIcon,snoIcon )

RETURN noOldIcon
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DC_IconDefault()

#5 Post by unixkd »

Hi Roger

Your suggested solution did not work. I discover that the DC_GetBitmap() returns the resource ID and not a Bitmap object from the ICON id passed.

Thanks.

Joe

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_IconDefault()

#6 Post by rdonnay »

Send me your .DLL and the resource number.
Better yet, send me a small sample of code too.
I will work on this and give you a solution.
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DC_IconDefault()

#7 Post by unixkd »

Hi Roger

I solved the problem.

it is required that one link the ICON resource to the EXE and the function will work correctly.

Thanks.

Joe

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_IconDefault()

#8 Post by rdonnay »

it is required that one link the ICON resource to the EXE and the function will work correctly.
I knew, of course, that this would work, but I thought you were trying to use the resource from a DLL.
The eXpress train is coming - and it has more cars.

Post Reply