Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, June 2007
Out of order resources (icon problem).


Message 1 in thread

Hi Everyone.

I have a bizarre problem, which I am unable to find a proper solution 
yet. Please help if you can. Thank you.

I am using Visual C++ 2003. I have 11 icons which I have embedded into 
the .exe. Then somewhere in my code, I have used shell commands to 
create a shortcut within windows. The shortcut shows the wrong icon i.e. 
it shows the picture of the 9th icon.

When the shortcut is right clicked and then the change icon is clicked, 
I could see it is highlighting the correct icon index, say the 1st icon 
(but this is not the correct icon, image-wise). Also some shortcuts are 
displaying correct icons with the correct indices and some are not. 
Example, first 5 shortcuts with iIndex 1..5 are wrong but last 5 
shortcuts with iIndex 6..10 are showing the correct icons with the 
correct indices.

The shortcuts are made with the WIN API,
SetIconLocation( szExeLocation.utf16( ), iIndex );

Is there something that I need to do to make the MS compiler talk to the 
QT plugin properly?

My resource viewer in the IDE for the project's .rc file is showing,
"IDI_ICON1"
"IDI_ICON10"
"IDI_ICON11"
"IDI_ICON2"
"IDI_ICON3"
"IDI_ICON4"
"IDI_ICON5"
"IDI_ICON6"
"IDI_ICON7"
"IDI_ICON8"
"IDI_ICON9"

--
 [ signature omitted ] 

Message 2 in thread

> The shortcuts are made with the WIN API,
> SetIconLocation( szExeLocation.utf16( ), iIndex );

To those who are interested.

A less painful way of doing it is to forget about embedding .ico into 
the .exe. Just set szExeLocation to point to the .ico directly.

Duh.

--
 [ signature omitted ]