473,508 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resources

H

When creating an SDK program using VC++.NET 2002, it seems that the icon with the lowest ID seems to be the icon that the executable file gains when it is shown in Windows Explorer. Furthermore, you can edit the resource.h file, to change which icon has the lowest ID in order to determine this, but when you build the project, it always overwrites the resource.h file, even though it keeps the IDs that you've chosen if you've reassigned them
Is this standard behaviour for .NET, or does it happen in VC6 aswell?
Nov 17 '05 #1
3 1335
"Bonj" <an*******@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
When creating an SDK program using VC++.NET 2002, it seems that the icon with the lowest ID seems to be the icon that the executable file
gains when it is shown in Windows Explorer. Furthermore, you can edit
the resource.h file, to change which icon has the lowest ID in order to
determine this, but when you build the project, it always overwrites the
resource.h file, even though it keeps the IDs that you've chosen if
you've reassigned them. Is this standard behaviour for .NET, or does it happen in VC6 aswell?


What do you refer to as "this" and "it" in the last sentense? Picking
the icon with the lowest ID to show for an executable is the standard
behavior of Windows Shell and has nothing to do with what compiler the
executable was built with.

As you say, the IDs you assign in resource.h are preserved, so I don't
see the problem here either.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Nov 17 '05 #2
> What do you refer to as "this" and "it" in the last sentense?

The method of how you tell the compiler what icon to make windows read as
the one to display as the icon in Windows explorer.

Picking
the icon with the lowest ID to show for an executable is the standard
behavior of Windows Shell and has nothing to do with what compiler the
executable was built with.
But how does windows know what compiler the program is built with, and how
does it know that it even uses IDs for its icons? I thought the chip that
gets fed the code when you run an .exe only understands machine language,
and hence the only thing that Windows explorer can use to glean the
information on what icon to display?

As you say, the IDs you assign in resource.h are preserved, so I don't
see the problem here either.
They are, but I didn't know that they were going to be! It was a stroke of
luck, I'm sure - so I thought it could be one of those features that they'd
built into .NET but wasn't compliant behaviour necessarily.

If you put it in release mode and compile it without using all the icons,
does it omit the unused icons from the .exe, in the same way that it does
for functions?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

Nov 17 '05 #3
"Bonj" <a@b.com> wrote in message
news:uZ**************@tk2msftngp13.phx.gbl...
Picking
the icon with the lowest ID to show for an executable is the standard behavior of Windows Shell and has nothing to do with what compiler the executable was built with.
But how does windows know what compiler the program is built with


It does not know nor care.
and how
does it know that it even uses IDs for its icons?
Because it's part of the Portable Executable format that every Windows
executable must conform to. You are confusing cause and effect. Windows
operating system defines the format of a valid executable file, and
compiler builds a file that conforms to this format, not the other way
round. The way to store resources in an executable, and assign IDs to
them, is part of this format.
I thought the chip that
gets fed the code when you run an .exe only understands machine language,

Resources are not code and are never executed. They are data, and are
simply read from the file. You aren't surprised that a text file does
not contain valid machine codes, right?
and hence the only thing that Windows explorer can use to glean the
information on what icon to display?
You thought wrong. There's more to PE format than just raw machine code.
Ever wondered where string literals go?
As you say, the IDs you assign in resource.h are preserved, so I don't see the problem here either.


They are, but I didn't know that they were going to be! It was a

stroke of luck, I'm sure - so I thought it could be one of those features that they'd built into .NET but wasn't compliant behaviour necessarily.
Compliant with what?
If you put it in release mode and compile it without using all the icons, does it omit the unused icons from the .exe, in the same way that it does for functions?


No.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2847
by: Derick Smith | last post by:
Hi! I am just starting to use .NET and need some help! If I create my own DLL for String resouces using this command: C:\WINNT\MICROS~1.NET\Framework\v1.1.4322\Al /t:lib...
3
12615
by: Jesse | last post by:
Hi together, I've a problem with compiling an application with a build-Script and run it after. Several resource-files I compile with resgen.exe and put the files into a folders of the...
1
2274
by: Stefan Turalski \(stic\) | last post by:
Hi, What I need to do is adding some support for resources files to my application. What I did is: MyAppMain <- startup project MyAppHelper <- project which has MyAppResourcesClass (al a...
4
39939
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that...
4
5867
by: Jon Rista | last post by:
I have a project where I need to create a windows .exe by compiling code and linking in some resources. This program thats being generated is somewhat unconventional, and I'll explain how. I'm...
0
2180
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have...
0
975
by: Derick Smith | last post by:
Hi! I am just starting to use .NET and need some help! If I create my own DLL for String resouces using this command: C:\WINNT\MICROS~1.NET\Framework\v1.1.4322\Al /t:lib...
0
9142
by: Rob Dob | last post by:
Hi, I have a VS2003 C# asp.net project that has been converted into a VS2005 project. Everything seemed to work well until I make a modification to anything within the Component Designer...
1
3194
by: spencermiles | last post by:
Hello, I'm working on a large solution, comprised on numerous Projects, and I would like to have one central projects that contains a set of global RESX Resources. It doesn't make sense to have...
0
3635
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.