Contributor
15May2009,02:21   #21
Panarchy's Avatar
I think you are speaking about the GUI method.

When compiling using the GUI, the icon is there.

I'm trying to compile the program via the command-line.

I've been able to get the program to work, however I can't get the icon to show up.

Any ideas?

Thanks in advance,

Panarchy
Contributor
15May2009,06:27   #22
Panarchy's Avatar
I got it to work by using the .res at the linking stage.



So I've now successfully worked out how to compile, the program via command-prompt, specifying the name, and having the correct icon.

Thanks for all your help.

Now, any ideas on how I can do this within my C++ code?

Thanks in advance,

Panarchy
Mentor
15May2009,10:34   #23
xpi0t0s's Avatar
Great stuff! What were the final commands you used?

Assuming you mean how can you get an icon using pure C++ code without any resources: You can't. Resources can be made programmatically and there is support in the WinAPI for that, but the way Windows draws an icon is by looking in the executable for icon resources. If you want to animate an icon like the way AVG modifies its tray icon, or the way Privoxy does the radar thing when loading a page, etc, then you do that with multiple icon resources and specify at runtime which resource is the current system tray icon or whatever.
Contributor
15May2009,13:30   #24
Panarchy's Avatar
link super-resouce.res main.obj
Contributor
15May2009,16:45   #25
Panarchy's Avatar
So... any idea how I can specify the name within the C++ code?

Thanks in advance for any help,

Panarchy
Contributor
24May2009,07:50   #26
Panarchy's Avatar
Hello Again!

I still haven't worked out how to do this .

Could someone please tell me how to set the name of the *.exe programmatically?

More info: http://msdn.microsoft.com/en-us/libr...utputfile.aspx

Please help me do this!

Thanks in advance,

Panarchy
Mentor
24May2009,20:35   #27
xpi0t0s's Avatar
Could you give a detailed description of the problem you're trying to solve?
In particular I'd like to understand why the approach I suggested before won't work, i.e. specifying the name of the executable at the command line and scripting the generation of the executables.
i.e.
Code:
cl prog.c -Dprog1_options -o prog1.exe
cl prog.c -Dprog2_options -o prog2.exe
cl prog.c -Dprog3_options -o prog3.exe
and in the code
Code:
#ifdef prog1_options
// do the prog1 stuff
#endif

#ifdef prog2_options
// do the prog2 stuff
#endif

// etc
Mentor
24May2009,20:49   #28
xpi0t0s's Avatar
The page reference leads to documentation on Customizing and Automating the Development Environment and for help with this I would recommend using the appropriate Microsoft newsgroups, you're more likely to find someone who will help you with this over there.
Contributor
25May2009,12:49   #29
Panarchy's Avatar
But this forum has been so helpful in the past...
Mentor
25May2009,14:39   #30
xpi0t0s's Avatar
And my other post (about a detailed description...)?