Click here to Skip to main content
15,897,185 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCAsyncSocket ::OnReceive() missed calls Pin
neilsolent25-Jul-06 21:31
neilsolent25-Jul-06 21:31 
AnswerRe: CAsyncSocket ::OnReceive() missed calls Pin
Steve S25-Jul-06 21:52
Steve S25-Jul-06 21:52 
GeneralRe: CAsyncSocket ::OnReceive() missed calls Pin
neilsolent25-Jul-06 22:57
neilsolent25-Jul-06 22:57 
GeneralRe: CAsyncSocket ::OnReceive() missed calls Pin
Moak4-Oct-06 5:09
Moak4-Oct-06 5:09 
GeneralRe: CAsyncSocket ::OnReceive() missed calls Pin
neilsolent5-Oct-06 8:05
neilsolent5-Oct-06 8:05 
QuestionGetVersionOfFile(); Pin
ningthemcha25-Jul-06 21:20
ningthemcha25-Jul-06 21:20 
QuestionRe: GetVersionOfFile(); Pin
see me25-Jul-06 21:28
see me25-Jul-06 21:28 
AnswerRe: GetVersionOfFile(); Pin
NiceNaidu25-Jul-06 21:31
NiceNaidu25-Jul-06 21:31 
a-> VersionBuffer
b-> Language Buffer

Here is the code for the function.

void GetVersionOfFile (char * pszAppName, // file<br />
                       char * pszVerBuff, // receives version<br />
                       int     iVerBuffLen, // size of buffer<br />
                       char * pszLangBuff, // receives language<br />
                       int iLangBuffLen) // size of buffer<br />
{<br />
   DWORD dwScratch;<br />
   DWORD * pdwLangChar;<br />
   DWORD dwInfSize ;<br />
   UINT uSize;<br />
   BYTE * pbyInfBuff;<br />
   char szVersion [32];<br />
   char szResource [80];<br />
   char * pszVersion = szVersion;<br />
<br />
   dwInfSize = GetFileVersionInfoSize (pszAppName, &dwScratch);<br />
<br />
   if (dwInfSize)<br />
   {<br />
      pbyInfBuff = new BYTE [dwInfSize];<br />
      memset (pbyInfBuff, 0, dwInfSize);<br />
      if (pbyInfBuff)<br />
      {<br />
         if (GetFileVersionInfo (pszAppName, 0, dwInfSize, pbyInfBuff))<br />
         {<br />
            if (VerQueryValue (pbyInfBuff,<br />
                               "\\VarFileInfo\\Translation",<br />
                               (void**)(&pdwLangChar),<br />
                               &uSize))<br />
            {<br />
               if (VerLanguageName (LOWORD (*pdwLangChar),<br />
                                    szResource,<br />
                                    sizeof(szResource)))<br />
               {<br />
                  strncpy (pszLangBuff, szResource, iLangBuffLen);<br />
               }<br />
               wsprintf (szResource, "\\StringFileInfo\\%04X%04X\\FileVersion",<br />
                         LOWORD (*pdwLangChar), HIWORD (*pdwLangChar));<br />
<br />
               if (VerQueryValue (pbyInfBuff,<br />
                                  szResource,<br />
                                  (void**)(&pszVersion),<br />
                                  &uSize))<br />
               {<br />
                  strncpy (pszVerBuff, pszVersion, iVerBuffLen-1);<br />
               }<br />
            }<br />
         }<br />
         delete [] pbyInfBuff;<br />
      }<br />
   }<br />
}


Appu..
"If you judge people, you have no time to love them."

GeneralRe: GetVersionOfFile(); Pin
Steve S25-Jul-06 21:45
Steve S25-Jul-06 21:45 
QuestionWhat happens when an Object of CWinApp derived Class is Created in MFC Pin
NiceNaidu25-Jul-06 20:14
NiceNaidu25-Jul-06 20:14 
AnswerRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
NiceNaidu25-Jul-06 21:33
NiceNaidu25-Jul-06 21:33 
AnswerRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
NiceNaidu25-Jul-06 21:34
NiceNaidu25-Jul-06 21:34 
GeneralRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
Steve S25-Jul-06 21:50
Steve S25-Jul-06 21:50 
GeneralRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
NiceNaidu25-Jul-06 22:46
NiceNaidu25-Jul-06 22:46 
GeneralRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
Steve S27-Jul-06 1:42
Steve S27-Jul-06 1:42 
QuestionThread?! Pin
tanarnelinistit25-Jul-06 20:02
tanarnelinistit25-Jul-06 20:02 
AnswerRe: Thread?! Pin
Aneesh Valeri25-Jul-06 20:14
Aneesh Valeri25-Jul-06 20:14 
QuestionRe: Thread?! [modified] Pin
tanarnelinistit25-Jul-06 20:20
tanarnelinistit25-Jul-06 20:20 
AnswerRe: Thread?! Pin
Hamid_RT25-Jul-06 20:23
Hamid_RT25-Jul-06 20:23 
AnswerRe: Thread?! Pin
Steve S25-Jul-06 22:14
Steve S25-Jul-06 22:14 
AnswerRe: Thread?! Pin
David Crow27-Jul-06 2:57
David Crow27-Jul-06 2:57 
Question3d max object Pin
ooola rocks25-Jul-06 19:59
ooola rocks25-Jul-06 19:59 
AnswerRe: 3d max object Pin
Hamid_RT25-Jul-06 20:12
Hamid_RT25-Jul-06 20:12 
AnswerRe: 3d max object Pin
Cedric Moonen25-Jul-06 20:38
Cedric Moonen25-Jul-06 20:38 
AnswerRe: 3d max object Pin
ldsdbomber26-Jul-06 5:20
ldsdbomber26-Jul-06 5:20 

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.