Click here to Skip to main content
14,299,900 members

C / C++ / MFC

 
GeneralRe: No Errors but wrong values on return? Pin
GESY29-Jul-18 6:00
memberGESY29-Jul-18 6:00 
QuestionCreateProcess lpApplicationName param Pin
ForNow23-Jul-18 16:16
memberForNow23-Jul-18 16:16 
AnswerRe: CreateProcess lpApplicationName param Pin
Richard MacCutchan23-Jul-18 22:46
protectorRichard MacCutchan23-Jul-18 22:46 
SuggestionRe: CreateProcess lpApplicationName param Pin
Jochen Arndt23-Jul-18 22:56
mveJochen Arndt23-Jul-18 22:56 
GeneralRe: CreateProcess lpApplicationName param Pin
Richard MacCutchan23-Jul-18 23:09
protectorRichard MacCutchan23-Jul-18 23:09 
AnswerRe: CreateProcess lpApplicationName param Pin
Jochen Arndt23-Jul-18 22:55
mveJochen Arndt23-Jul-18 22:55 
GeneralRe: CreateProcess lpApplicationName param Pin
ForNow23-Jul-18 23:35
memberForNow23-Jul-18 23:35 
GeneralRe: CreateProcess lpApplicationName param Pin
Jochen Arndt23-Jul-18 23:55
mveJochen Arndt23-Jul-18 23:55 
You have to know (and usually will know) where the file is stored. Where is the problem using the full path?

GetCurrentDirectory() returns the actual working directory of the session. It is not related in any way to the application calling that function (besides the application has set the working directory explicitly).

Again: Use full pathes. If necessary create them dynamically during runtime. But never expect the current working directory to be a specific one if you have not set it. But when setting it, you can also create full pathes instead.

If you need to know where the application actually executed is stored, access the first command line parameter argv[0] in your main() function. That contains the full path of the executable. Or use the GetModuleFileName function (Windows)[^] with the first parameter set to NULL. With both methods you can extract the path which can be for example used to access other files known to exist in the same directory or a sub directory.
GeneralRe: CreateProcess lpApplicationName param Pin
ForNow24-Jul-18 1:42
memberForNow24-Jul-18 1:42 
QuestionTechnical Interview Preparation Pin
Member 1392070221-Jul-18 0:50
memberMember 1392070221-Jul-18 0:50 
AnswerRe: Technical Interview Preparation Pin
Richard MacCutchan21-Jul-18 1:12
protectorRichard MacCutchan21-Jul-18 1:12 
AnswerRe: Technical Interview Preparation Pin
CPallini22-Jul-18 21:52
mveCPallini22-Jul-18 21:52 
QuestionAPI to change win10 touchpad 'Cursor speed' dynamically without restarting Pin
AroraSaurabh19-Jul-18 6:59
memberAroraSaurabh19-Jul-18 6:59 
GeneralRe: API to change win10 touchpad 'Cursor speed' dynamically without restarting Pin
Richard MacCutchan19-Jul-18 21:24
protectorRichard MacCutchan19-Jul-18 21:24 
AnswerRe: API to change win10 touchpad 'Cursor speed' dynamically without restarting Pin
Randor 20-Jul-18 21:30
professional Randor 20-Jul-18 21:30 
QuestionRegistering a IOT Device in C++ Pin
Member 1391379016-Jul-18 9:20
memberMember 1391379016-Jul-18 9:20 
GeneralRe: Registering a IOT Device in C++ Pin
Richard MacCutchan17-Jul-18 2:03
protectorRichard MacCutchan17-Jul-18 2:03 
QuestionCChildFrame in separate thread Pin
_Flaviu15-Jul-18 22:06
member_Flaviu15-Jul-18 22:06 
AnswerRe: CChildFrame in separate thread Pin
Jochen Arndt15-Jul-18 22:37
mveJochen Arndt15-Jul-18 22:37 
GeneralRe: CChildFrame in separate thread Pin
_Flaviu15-Jul-18 22:52
member_Flaviu15-Jul-18 22:52 
GeneralRe: CChildFrame in separate thread Pin
Jochen Arndt15-Jul-18 23:21
mveJochen Arndt15-Jul-18 23:21 
GeneralRe: CChildFrame in separate thread Pin
_Flaviu16-Jul-18 0:36
member_Flaviu16-Jul-18 0:36 
GeneralRe: CChildFrame in separate thread Pin
Jochen Arndt16-Jul-18 0:41
mveJochen Arndt16-Jul-18 0:41 
GeneralRe: CChildFrame in separate thread Pin
_Flaviu16-Jul-18 1:27
member_Flaviu16-Jul-18 1:27 
GeneralRe: CChildFrame in separate thread Pin
Jochen Arndt16-Jul-18 2:49
mveJochen Arndt16-Jul-18 2:49 

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.