Click here to Skip to main content
15,908,634 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on project which is creating package need to be deploy on client pc when client/end user open the product and need help he or she need to give version# and date I want to include this information in Help->> About page How can I do that.
When I deploy this software it reside in C drive has version # 13,0,0,0 built on date 00/00/0000 how can I do that.

Thank you very much
Posted

The easiest way, I think, is to have a prebuild task that writes that info in to a file that is a resource, so you can read it from there. I am sure you can write code to get the version #, I am not so sure it's possible to write code that gets the build date, I think you need to build your own mechanism for that.
 
Share this answer
 
Comments
Vijay Pate 7-Feb-12 11:44am    
How about just Version #

I have figure it out to insert Date into Registry
Christian Graus 7-Feb-12 12:05pm    
OK, I thought you wanted the build date, how does the program know what that was to store it in the users registry ?
Vijay Pate 7-Feb-12 14:49pm    
Mr Graus,

I am creating VC++ apps with MFC and in Manuitem I have Help section which consist of About Product which has all the information but dosent have Version # and build date. and I am trying to include Version and build date in the help >> About Product.


I am including some of my code which consist of About information which will be helpfull what i am trying to do :


// Addapt.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "Addaptapp.h"
#include <afxwin.h>

#include "AddInChildFrm.h"
#include "FaultFIFOChildFrame.h"
#include "AddaptDoc.h"
#include "AddaptView.h"

#include "AddaptDocTemplate.h"
#include "AddInManager.h"

#include "TextDoc.h"
#include "TextView.h"

#include "DSDoc.h"
#include "DSGridFrm.h"

#include "PWDoc.h"
#include "PWReg.h"
#include "PWAppIO.h"
#include "PWUpdate.h"
#include "PWLogin.h"
#include "PWChgDlg.h"
#include "PWGridFrm.h"
#include "time.h"

#include "FaultFifoView.h"
#include "FaultFifoDoc.h"

#include "FileNewDlg.h"
#include "CfgDirDlg.h"
#include "ProductCode.h"
#include "Splash.h"

#include "AddaptMDIChildFrame.h"
#include "DriveFrame.h"

#include "Parameters.h"
#include "OptionsPropertySheet.h"

#include <winnetwk.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

// the help file name


//#define _CRTDBG_MAP_ALLOC
//#include <stdlib.h>
//#include <crtdbg.h>

/////////////////////////////////////////////////////////////////////////////
// CAddaptApp
BEGIN_MESSAGE_MAP(CAddaptApp, CWinApp)
//{{AFX_MSG_MAP(CAddaptApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_OPEN_DEFAULTCFG, OnOpenDefaultCfg)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_HELP, OnHelp)
//}}AFX_MSG_MAP

ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnEnableFileNew)
ON_UPDATE_COMMAND_UI(ID_EDIT_CUT, OnEnableEditCut)

ON_UPDATE_COMMAND_UI(ID_OPEN_DEFAULTCFG, OnEnableDefaultConfig)

ON_COMMAND(ID_CONFIG_FILES, OnConfigFilesDlg)
ON_UPDATE_COMMAND_UI(ID_CONFIG_FILES, OnEnableConfigFilesDlg)

ON_UPDATE_COMMAND_UI(IDC_ADD_STTN, OnEnableAddSection)
ON_COMMAND(IDC_ADD_STTN, OnAddSection)

ON_UPDATE_COMMAND_UI(IDC_ADD_ROW, OnEnableAddRow)
ON_COMMAND(IDC_ADD_ROW, OnAddRow)

ON_COMMAND(ID_CAL_FILE_NEW, OnCalFileOpen)
ON_UPDATE_COMMAND_UI(ID_CAL_FILE_NEW, OnEnableCalFileOpen)

ON_UPDATE_COMMAND_UI(ID_ACTIVITY, OnCheckActivityIndicator)
ON_COMMAND(ID_ACTIVITY, OnActivityIndicator)
ON_UPDATE_COMMAND_UI(IDC_DRIVEGRID, OnEnableDSGrid)
ON_COMMAND(IDC_DRIVEGRID, OnDSGrid)

ON_UPDATE_COMMAND_UI(IDC_LOGIN, OnEnableLogin)
ON_COMMAND(IDC_LOGIN, OnLogin)
ON_UPDATE_COMMAND_UI(IDC_LOGOUT, OnEnableLogout)
ON_COMMAND(IDC_LOGOUT, OnLogout)

ON_UPDATE_COMMAND_UI(IDC_PRODUCT_CODE, OnEnableProductCode)
ON_COMMAND(IDC_PRODUCT_CODE, OnProductCode)

ON_UPDATE_COMMAND_UI(IDC_CHANGE_PASSWORD, OnEnableChangePassword)
ON_COMMAND(IDC_CHANGE_PASSWORD, OnChangePassword)
ON_UPDATE_COMMAND_UI(IDC_CONFIGURE, OnEnablePasswordConfig)
ON_COMMAND(IDC_CONFIGURE, OnPasswordConfig)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAddaptApp construction
CAddaptApp::CAddaptApp() : m_pFaultFIFOTemplate(NULL), m_bGXInitialized(FALSE),
m_bConfigOpen(FALSE), m_bEthernet(FALSE), m_b8024(FALSE),
m_bMonitorActivity(FALSE), m_bDSGridStatus(0),
m_bRestoreWindows(0), m_bCanAdd(0), m_bBlockCommTest(0),
m_bIsWindowsNT4orLater(0), m_bIsWindows98orLater(0),
m_bBeta(0)
{
m_hwndDialog=NULL;
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CAddaptApp object
CAddaptApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CAddaptApp initialization
BOOL CAddaptApp::InitInstance()

{
Christian Graus 7-Feb-12 14:51pm    
This is an insane code dump, it does not help. Like I said, you want to create a text file, which your project includes as a resource, write a pre build step that writes the correct data to that file, and write an about box that reads that data from that resource.
Vijay Pate 7-Feb-12 15:11pm    
thank you very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900