473,395 Members | 1,649 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can I populate variables at compile time?

I would like to put program info in my applications' about screen such as
compile date & time, lines of code, etc. Is there a way to do this
automatically when I compile?
Nov 21 '05 #1
6 1969
Hello Terry,

It might be worth looking at the Visual Studio Extensibility Center at:

http://msdn.microsoft.com/vstudio/extend/

Hope this helps,

Andrew McNerlin
I would like to put program info in my applications' about screen such
as compile date & time, lines of code, etc. Is there a way to do this
automatically when I compile?

Nov 21 '05 #2
You can get the version number of you application. and if you auto increment
your version number, you do get something similar to what you want.

The other thing you can try is to take the Date and Time of creation of your
assembly to be the compilation time and dispaly that.

--
Rgds,
Anand
VB.NET MVP
http://www.dotnetindia.com
"Terry Olsen" wrote:
I would like to put program info in my applications' about screen such as
compile date & time, lines of code, etc. Is there a way to do this
automatically when I compile?

Nov 21 '05 #3
"Terry Olsen" <to******@hotmail.com> schrieb:
I would like to put program info in my applications' about screen such as
compile date & time, lines of code, etc. Is there a way to do this
automatically when I compile?


Not directly. I am curious why you don't want to set the labels' text at
runtime.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
Herfried,

Not directly. I am curious why you don't want to set the labels' text at
runtime.

I think that at least beside Terry, Anand, Andrew, I (and when you reread
the question) you do that.

It can in some cases be handy.

:-)

Cor
Nov 21 '05 #5
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb:
Not directly. I am curious why you don't want to set the labels' text at
runtime.

I think that at least beside Terry, Anand, Andrew, I (and when you reread
the question) you do that.


I misread the OP's post. I thought he wanted to display simple version
information only.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6
Terry,
As the others suggest, getting lines of code is going to be challenging, I
seriously question the usefulness of it in an about box.

Compile date & time would be useful, but I have not found a good method of
retrieving it. I've considered a custom attribute, however I'm not sure how
one would define said attribute, as one would need the value of the
attribute set at compile time. A pre-compile utility that initialized the
attribute value (ala the AssemblyVersion attribute) might be useful.

Generally I display a number of Assembly level attributes in my About Box,
including by not limited to:

Assembly.GetName().Name
Assembly.GetName().Version
AssemblyTitleAttribute.Title
AssemblyProductAttribute.Product ' product name
AssemblyInformationVersionAttribute.InformationalV ersion ' product
version
AssemblyConfigurationAttribute.Configuration ' Debug/Release
AssemblyFileVersionAttribute.Version

In fact I display the above info for all loaded assemblies in a grid (ala
the VS about box) to see version info for class libraries...

A VS 2005 version (it uses Generics) of my AboutBoxForm is available as part
of the of my Xml Export Example at:

http://www.tsbradley.net/Samples/VST...rt.Sample.aspx

I hope to have a VS 2003 version as a recipe at the above site later this
week...

--
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Terry Olsen" <to******@hotmail.com> wrote in message
news:uc**************@TK2MSFTNGP14.phx.gbl...
|I would like to put program info in my applications' about screen such as
| compile date & time, lines of code, etc. Is there a way to do this
| automatically when I compile?
|
|
Nov 21 '05 #7

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

Similar topics

10
by: Scott Brady Drummonds | last post by:
Hi, everyone, I'm still learning Python as I develop a medium-sized project. From my previous experience with C++, I've burnt into my mind the notion of information hiding. I'm having trouble...
6
by: David T. Ashley | last post by:
Hi, In my project, I typically declare and define variables in the .H file, i.e. DECMOD_MAIN UINT8 can_message_201_status_global #ifdef MODULE_MAIN = HAS_NEVER_BEEN_RECEIVED #endif ;
2
by: M | last post by:
Have you come accross the issue described below or know more about it? We have come accross a situation where session variables are getting lost temporarily but come back again if user reloads...
3
by: pauldepstein | last post by:
Sorry in advance if this message sounds imprecise but it's difficult to be precise when you don't really understand what's going on. I have a class called Parameters. The default constructor...
8
by: mantrid | last post by:
Hello I have the following code, where clicking yh1r is supposed to move h1 10px down and update the value of yh1 by 20 each time its clicked. what the code actually does is NOT move h1 and...
111
by: Nate | last post by:
Hello, I am looking for a method to automatically declare variables in C. I'm not sure if there is a good way to do this, but I had something like this in mind... int i; for(i = 1; i < 4;...
58
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is...
12
by: Kevin Walzer | last post by:
I'm trying to learn C. I have a fairly extensive background with C-based scripting languages (Python,Tcl, others), so a great deal of C is proving easy to pick up (control structures, functions,...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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
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,...

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.