Click here to Skip to main content
14,662,662 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 8:09
MemberDavid Crow3-Sep-20 8:09 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 9:27
MemberVictor Nijegorodov3-Sep-20 9:27 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:07
MemberVictor Nijegorodov3-Sep-20 8:07 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:47
MemberVictor Nijegorodov3-Sep-20 7:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 11:41
Memberjackngill3-Sep-20 11:41 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 22:29
MemberVictor Nijegorodov3-Sep-20 22:29 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 4:08
MemberVictor Nijegorodov3-Sep-20 4:08 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill4-Sep-20 2:11
Memberjackngill4-Sep-20 2:11 
Hi Victor
Many thanks can I take a further liberty in answering your question with yet another question?
Your "?" - Did you try GetEnvironmentVariable function (winbase.h) - Win32 apps | Microsoft Docs ?
Can I answer with:
Is there (of some Kind like for instance Emu8086) that would be able to run C++ code to check if it works & possibly feedback errors compatable that is compatable with XP as my skills in C++ are shall we say are very sadly lacking as suggested in my 1st post. I know what I want to do but don't know how to get there. The short answer is no sorry!

I have been researching further & I have found this snippet of code from (To reveal the source click on the link below)
C++/CLI Code Snippet - Access current environment directories and logical drives[^]

which states this
// Gets the home drive - %HOMEDRIVE% (possible HOMEDRIVE is related to Windows7)
// Typical value - C:
Console::WriteLine("Get Environment Variable: Home Drive " + Environment::GetEnvironmentVariable("HOMEDRIVE"));

However Line 15 (the last 2 lines) is all one line & it states Writeline which infers output to console?
Then could Homedrive be called/injected into this line in the first post
SetSfcFileException(0, L"c:\\windows\\system32\\calc.exe",-1);

like this:
SetSfcFileException(0, L"HOMEDRIVE:\\windows\\system32\\calc.exe",-1);


I am assuming I would need new headers & would need to know where to insert the code. I am assuming prior to the execution of the code in the 1st post I made (which I did not write), because once the code is executed within the C++ it would remain memory resident to access later to envoke the HOMEDRIVE system variable. Hope I am not blowing smoke here just a theory?

P.S. Is the C++ code in post 1 for windows or commandline as the above code I think is for commandline, I wouldn't have thought mixing code from two standpoints would Not be Good?

All the best,

Jackngill

modified 4-Sep-20 9:35am.

GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov4-Sep-20 7:59
MemberVictor Nijegorodov4-Sep-20 7:59 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill4-Sep-20 10:06
Memberjackngill4-Sep-20 10:06 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov4-Sep-20 21:37
MemberVictor Nijegorodov4-Sep-20 21:37 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill4-Sep-20 23:05
Memberjackngill4-Sep-20 23:05 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov4-Sep-20 23:19
MemberVictor Nijegorodov4-Sep-20 23:19 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill4-Sep-20 23:54
Memberjackngill4-Sep-20 23:54 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov5-Sep-20 0:07
MemberVictor Nijegorodov5-Sep-20 0:07 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill5-Sep-20 2:34
Memberjackngill5-Sep-20 2:34 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov5-Sep-20 4:32
MemberVictor Nijegorodov5-Sep-20 4:32 
QuestionHi I am trying to overload >> operator for custom templated vector class but getting error Undifined Type 'T' Pin
vinay10829-Aug-20 17:54
Membervinay10829-Aug-20 17:54 
AnswerRe: Hi I am trying to overload >> operator for custom templated vector class but getting error Undifined Type 'T' Pin
Greg Utas30-Aug-20 2:06
professionalGreg Utas30-Aug-20 2:06 
GeneralRe: Hi I am trying to overload >> operator for custom templated vector class but getting error Undifined Type 'T' Pin
vinay10830-Aug-20 7:01
Membervinay10830-Aug-20 7:01 
GeneralRe: Hi I am trying to overload >> operator for custom templated vector class but getting error Undifined Type 'T' Pin
Greg Utas30-Aug-20 7:06
professionalGreg Utas30-Aug-20 7:06 
AnswerRe: Hi I am trying to overload >> operator for custom templated vector class but getting error Undifined Type 'T' Pin
Mircea Neacsu30-Aug-20 2:07
MemberMircea Neacsu30-Aug-20 2:07 
GeneralRe: Hi I am trying to overload >> operator for custom templated vector class but getting error Undifined Type 'T' Pin
vinay10830-Aug-20 7:05
Membervinay10830-Aug-20 7:05 
AnswerRe: Hi I am trying to overload >> operator for custom templated vector class but getting error Undifined Type 'T' Pin
Stefan_Lang31-Aug-20 23:53
mveStefan_Lang31-Aug-20 23:53 
QuestionWhy does a letter disappear when I'm writing the following (the problem is the underlined code.) Pin
hubblee28-Aug-20 10:38
Memberhubblee28-Aug-20 10:38 

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.