0
Panarchy's Avatar, Join Date: Nov 2007
Contributor
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
0
Panarchy's Avatar, Join Date: Nov 2007
Contributor
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
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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.
0
Panarchy's Avatar, Join Date: Nov 2007
Contributor
link super-resouce.res main.obj
0
Panarchy's Avatar, Join Date: Nov 2007
Contributor
So... any idea how I can specify the name within the C++ code?

Thanks in advance for any help,

Panarchy
0
Panarchy's Avatar, Join Date: Nov 2007
Contributor
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
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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.
0
Panarchy's Avatar, Join Date: Nov 2007
Contributor
But this forum has been so helpful in the past...
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
And my other post (about a detailed description...)?