Home All Groups Group Topic Archive Search About

Change ICON automatically at build time

Author
29 Nov 2007 4:18 PM
PeterD
OK, I've an application that produces two executables based on a
compile (build) time setting. I use conditionals to control things
like string values, etc. (Think of this as a multi-language
application--it isn't but that model works).

I want each of the two versions ot have a different icon. I can save
an icon in the resources, but until the program runs, they have the
icon that is set in the main form as the applicaiton's icon. So when
using Windows Explorer one sees the wrong icon for one of the two
builds.

Is there a way with conditional building to set the icon that is the
main form's (or application's) icon?

(VB6...)

Author
29 Nov 2007 4:34 PM
Ken Halter
"PeterD" <pet***@hipson.net> wrote in message
news:1dptk3h7itst93srhcqpg8im97kqqvpjtk@4ax.com...
> OK, I've an application that produces two executables based on a
> compile (build) time setting. I use conditionals to control things
> like string values, etc. (Think of this as a multi-language
> application--it isn't but that model works).

I've only had to do this once... but, what I did was create 2 separate
project files (vbp's). It actually turned out to be fairly easy. Especially
since I also set the conditional compile variables to different values in
both projects... I found it easier to open a separate project, than it was
to remember to set the conditionals <g>

The name of your compiled component is completely independant of the VBPs
name, so it's fairly easy to maintain. fwiw, I kept both VBPs in the same
folder and source safe project.


--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Author
29 Nov 2007 6:51 PM
PeterD
On Thu, 29 Nov 2007 08:34:18 -0800, "Ken Halter"
<Ken_Halter@Use_Sparingly_Hotmail.com> wrote:

Show quote
>"PeterD" <pet***@hipson.net> wrote in message
>news:1dptk3h7itst93srhcqpg8im97kqqvpjtk@4ax.com...
>> OK, I've an application that produces two executables based on a
>> compile (build) time setting. I use conditionals to control things
>> like string values, etc. (Think of this as a multi-language
>> application--it isn't but that model works).
>
>I've only had to do this once... but, what I did was create 2 separate
>project files (vbp's). It actually turned out to be fairly easy. Especially
>since I also set the conditional compile variables to different values in
>both projects... I found it easier to open a separate project, than it was
>to remember to set the conditionals <g>
>
>The name of your compiled component is completely independant of the VBPs
>name, so it's fairly easy to maintain. fwiw, I kept both VBPs in the same
>folder and source safe project.

Ken, good suggestion... I probably can do that without much trouble at
all. Actually an improvement, really over what I'm doing now.
Author
29 Nov 2007 7:33 PM
Karl E. Peterson
PeterD wrote:
> Is there a way with conditional building to set the icon that is the
> main form's (or application's) icon?

The (now) free vbAdvance add-in supports an AppIconFile entry in VBP files.  You
could conceivably automate the builds at the command line, using your favorite
textfile manipulation tool to change this value as needed.
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
29 Nov 2007 9:44 PM
PeterD
On Thu, 29 Nov 2007 11:33:41 -0800, "Karl E. Peterson" <k***@mvps.org>
wrote:

>PeterD wrote:
>> Is there a way with conditional building to set the icon that is the
>> main form's (or application's) icon?
>
>The (now) free vbAdvance add-in supports an AppIconFile entry in VBP files.  You
>could conceivably automate the builds at the command line, using your favorite
>textfile manipulation tool to change this value as needed.

I implemneted Ken's suggestion and it works well for me. I created two
(blank) forms to hold just the icons, and changed each project to
point the the correct form.
Author
29 Nov 2007 9:58 PM
Karl E. Peterson
PeterD wrote:
Show quote
> On Thu, 29 Nov 2007 11:33:41 -0800, "Karl E. Peterson" <k***@mvps.org>
> wrote:
>
>> PeterD wrote:
>>> Is there a way with conditional building to set the icon that is the
>>> main form's (or application's) icon?
>>
>> The (now) free vbAdvance add-in supports an AppIconFile entry in VBP files.  You
>> could conceivably automate the builds at the command line, using your favorite
>> textfile manipulation tool to change this value as needed.
>
> I implemneted Ken's suggestion and it works well for me. I created two
> (blank) forms to hold just the icons, and changed each project to
> point the the correct form.

That's probably a cleaner answer, in this case, yeah.
--
..NET: It's About Trust!
http://vfred.mvps.org

AddThis Social Bookmark Button