Click here to Skip to main content
16,016,229 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHello how to change the real destination address with my own? Pin
nah133717-Aug-08 9:00
nah133717-Aug-08 9:00 
QuestionRtlInitUnicodeString Pin
gayatri.neelema17-Aug-08 6:10
gayatri.neelema17-Aug-08 6:10 
AnswerRe: RtlInitUnicodeString Pin
Jijo.Raj17-Aug-08 8:37
Jijo.Raj17-Aug-08 8:37 
GeneralRe: RtlInitUnicodeString Pin
gayatri.neelema17-Aug-08 21:43
gayatri.neelema17-Aug-08 21:43 
QuestionRe: RtlInitUnicodeString Pin
David Crow18-Aug-08 4:07
David Crow18-Aug-08 4:07 
QuestionRe: RtlInitUnicodeString Pin
David Crow17-Aug-08 16:13
David Crow17-Aug-08 16:13 
AnswerRe: RtlInitUnicodeString Pin
Hamid_RT18-Aug-08 5:12
Hamid_RT18-Aug-08 5:12 
Questionhow to extract "versioninfo" from sourcecode? Pin
rolfhorror17-Aug-08 2:28
rolfhorror17-Aug-08 2:28 
i have the following code, it compiles without error,
but how can i extract this into a global CString that i can use later for ie in an messagebox or something? i've tried several names in the code but i cant get a hold of them..


//the code
string FixedModuleVersion()
{
char file_name[ MAX_PATH ];
GetModuleFileName( ::GetModuleHandle( NULL ), file_name, MAX_PATH );
DWORD dwDummyHandle;
DWORD len = GetFileVersionInfoSize( file_name, &dwDummyHandle );
vector<byte> buf( len );
::GetFileVersionInfo( file_name, 0, len, buf.begin() );
unsigned int ver_length;
LPVOID lpvi;
::VerQueryValue( buf.begin(),
"\\",
&lpvi,
&ver_length );
VS_FIXEDFILEINFO fileInfo;
fileInfo = *(VS_FIXEDFILEINFO*)lpvi;
stringstream s;
s <<HIWORD(fileInfo.dwFileVersionMS) <<"."
<<LOWORD(fileInfo.dwFileVersionMS) <<"."
<<HIWORD(fileInfo.dwFileVersionLS) <<"."
<<LOWORD(fileInfo.dwFileVersionLS);

return s.str();
}
//
// This routine will extract the version string from the
// string version resource in the RC file for the current module.
// Note that you must add version.lib to your project to
// link to the Win32 versioning API calls. The actual call
// VerQueryValue() uses a value of 040904B0 for the language
// and character set. This value is equivalent to English
// language text encoded using Unicode.
//
string StringModuleVersion()
{
char file_name[ MAX_PATH ];
GetModuleFileName( ::GetModuleHandle( NULL ), file_name, MAX_PATH );
DWORD dwDummyHandle;
DWORD len = GetFileVersionInfoSize( file_name, &dwDummyHandle );
vector<byte> buf( len );
::GetFileVersionInfo( file_name, 0, len, buf.begin() );
char *version;

unsigned int ver_length;

::VerQueryValue( buf.begin(),
"\\StringFileInfo\\040904B0\\FileVersion",
(void **) &version,
&ver_length );

return string( version, ver_length );
}

//end - now how to get hold of something to use?
AnswerRe: how to extract "versioninfo" from sourcecode? Pin
Ștefan-Mihai MOGA17-Aug-08 2:44
professionalȘtefan-Mihai MOGA17-Aug-08 2:44 
GeneralRe: how to extract "versioninfo" from sourcecode? Pin
rolfhorror17-Aug-08 6:40
rolfhorror17-Aug-08 6:40 
QuestionVC++,how to expnding certain node in tree control Pin
akira3216-Aug-08 22:43
akira3216-Aug-08 22:43 
AnswerRe: VC++,how to expnding certain node in tree control [modified] Pin
Cliff Hatch17-Aug-08 0:43
Cliff Hatch17-Aug-08 0:43 
Questionmacro function compiles error,can anybody explain why?3x! Pin
joypain16-Aug-08 19:23
joypain16-Aug-08 19:23 
AnswerRe: macro function compiles error,can anybody explain why?3x! Pin
Humayun Kabir Hemoo16-Aug-08 19:45
Humayun Kabir Hemoo16-Aug-08 19:45 
GeneralRe: macro function compiles error,can anybody explain why?3x! Pin
super_ttd17-Aug-08 5:34
super_ttd17-Aug-08 5:34 
AnswerRe: macro function compiles error,can anybody explain why?3x! Pin
Karthik Kalyanasundaram16-Aug-08 22:25
Karthik Kalyanasundaram16-Aug-08 22:25 
AnswerRe: macro function compiles error,can anybody explain why?3x! Pin
Cedric Moonen16-Aug-08 23:11
Cedric Moonen16-Aug-08 23:11 
GeneralRe: macro function compiles error,can anybody explain why?3x! Pin
joypain17-Aug-08 7:17
joypain17-Aug-08 7:17 
QuestionOpening External Programs Pin
C# Beginner Nick16-Aug-08 15:41
C# Beginner Nick16-Aug-08 15:41 
AnswerRe: Opening External Programs Pin
David Crow16-Aug-08 15:52
David Crow16-Aug-08 15:52 
GeneralRe: Opening External Programs Pin
C# Beginner Nick16-Aug-08 16:58
C# Beginner Nick16-Aug-08 16:58 
GeneralRe: Opening External Programs Pin
Cedric Moonen16-Aug-08 21:25
Cedric Moonen16-Aug-08 21:25 
QuestionRe: Opening External Programs Pin
David Crow17-Aug-08 15:12
David Crow17-Aug-08 15:12 
AnswerRe: Opening External Programs Pin
Mark Salsbery18-Aug-08 8:32
Mark Salsbery18-Aug-08 8:32 
QuestionFind the SW_XXX State from within an App. Pin
Bram van Kampen16-Aug-08 12:54
Bram van Kampen16-Aug-08 12:54 

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.