Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File Version Pin
David Crow15-Sep-05 7:34
David Crow15-Sep-05 7:34 
GeneralRe: File Version Pin
Supriya Tonape15-Sep-05 22:04
Supriya Tonape15-Sep-05 22:04 
GeneralRe: File Version Pin
David Crow16-Sep-05 2:05
David Crow16-Sep-05 2:05 
GeneralRe: File Version Pin
Supriya Tonape16-Sep-05 4:10
Supriya Tonape16-Sep-05 4:10 
GeneralRe: File Version Pin
David Crow16-Sep-05 4:48
David Crow16-Sep-05 4:48 
GeneralRe: File Version Pin
Supriya Tonape7-Oct-05 1:49
Supriya Tonape7-Oct-05 1:49 
GeneralRe: File Version Pin
Supriya Tonape7-Oct-05 2:07
Supriya Tonape7-Oct-05 2:07 
AnswerRe: File Version Pin
ky_rerun16-Sep-05 5:06
ky_rerun16-Sep-05 5:06 
typedef struct _verStruct<br />
	{<br />
		unsigned short Minor;<br />
		unsigned short Major;<br />
	}VerStruct;<br />
	stringstream SS;<br />
   char *pBuff;<br />
	char SubBlock[255];<br />
	VerStruct *MajorVer,*MinorVer;<br />
	WORD wCountry = 0x0409;<br />
	WORD wCodePage = 0x0000;<br />
	void *Base;<br />
	VS_FIXEDFILEINFO *FileVerInfo;<br />
	unsigned int Length;<br />
	pBuff=NULL;<br />
	<br />
	string FileName;<br />
	try<br />
	{<br />
		//Get the version of the local file<br />
		strcpy(SubBlock,"");<br />
      FileName = "SomeFile"<br />
		Length = GetFileVersionInfoSize(FileName.c_str(),0);<br />
		pBuff = (char *)calloc(sizeof(char),Length);<br />
		GetFileVersionInfo(FileName.c_str(),NULL,Length,pBuff);<br />
		DWORD ErrorNum = VerQueryValue(pBuff,"\\",(void **)&FileVerInfo,&Length);<br />
		Base = &(FileVerInfo->dwProductVersionMS); //asign the address to a void PTR<br />
		MajorVer = (VerStruct *)Base;                 //Type case as a VerStruct<br />
      Base = &(FileVerInfo->dwProductVersionLS);<br />
      MinorVer = (VerStruct *)Base;<br />
   }<br />
   catch(...)<br />
   {<br />
      string Message = "Unable to determin the Local version";<br />
      _bstr_t OutMessage = Message.c_str();<br />
      return Error((BSTR )OutMessage);<br />
   }<br />
   SS << MajorVer->Major << "." << MajorVer->Minor << "." << MinorVer->Major << "." << MinorVer->Minor;<br />
   _bstr_t OutVal;<br />
   OutVal = SS.str().c_str();<br />
   *pVal = OutVal.copy();<br />
	return S_OK;




a programmer traped in a thugs body
GeneralRe: File Version Pin
Supriya Tonape7-Oct-05 2:08
Supriya Tonape7-Oct-05 2:08 
QuestionProblem with CString Pin
rajeevktripathi15-Sep-05 2:24
rajeevktripathi15-Sep-05 2:24 
AnswerRe: Problem with CString Pin
ThatsAlok15-Sep-05 2:44
ThatsAlok15-Sep-05 2:44 
AnswerRe: Problem with CString Pin
22491715-Sep-05 2:56
22491715-Sep-05 2:56 
AnswerRe: Problem with CString Pin
MailtoGops15-Sep-05 2:58
MailtoGops15-Sep-05 2:58 
QuestionAfx Message Handling in CStatic as Child-Window Pin
_NielsB15-Sep-05 2:19
_NielsB15-Sep-05 2:19 
QuestionRe: Afx Message Handling in CStatic as Child-Window Pin
Maximilien15-Sep-05 2:28
Maximilien15-Sep-05 2:28 
AnswerRe: Afx Message Handling in CStatic as Child-Window Pin
khan++15-Sep-05 2:34
khan++15-Sep-05 2:34 
GeneralRe: Afx Message Handling in CStatic as Child-Window Pin
_NielsB15-Sep-05 2:47
_NielsB15-Sep-05 2:47 
Questionhelp for VOIP Pin
vikas amin15-Sep-05 2:13
vikas amin15-Sep-05 2:13 
QuestionAbout Bitmaps: Plz Help Pin
parims15-Sep-05 2:07
parims15-Sep-05 2:07 
AnswerRe: About Bitmaps: Plz Help Pin
Cool Ju15-Sep-05 2:43
Cool Ju15-Sep-05 2:43 
Questionpreview and print access 2000 reports from a visual c++ application Pin
Hervy15-Sep-05 2:00
Hervy15-Sep-05 2:00 
QuestionAbout Cursor blinking : Plz Help Pin
parims15-Sep-05 1:29
parims15-Sep-05 1:29 
AnswerRe: About Cursor blinking : Plz Help Pin
khan++15-Sep-05 1:44
khan++15-Sep-05 1:44 
QuestionCToolBar Question Pin
Joel Holdsworth15-Sep-05 1:16
Joel Holdsworth15-Sep-05 1:16 
QuestionDebug assertion failed Pin
Hervy15-Sep-05 0:47
Hervy15-Sep-05 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.