karthikr
asked on
Current Directory
I have a question regarding GetCurrentDirectory SDK Function. It takes two parameters one the length of hte buffer and the character string.
I wanted to know whether there are some other functions in MFC to get the current directory which can circumvent the Length parameter. Is there any way to get the Current Working directory using MFC and something which returns CString.
I wanted to know whether there are some other functions in MFC to get the current directory which can circumvent the Length parameter. Is there any way to get the Current Working directory using MFC and something which returns CString.
try _getcwd() its stl, and u hand it the buffer
oops.... MAX_FILE should read as MAX_PATH .. :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops, forgot to add that second parameter.
GetCurrentDirectory( strDirectory.GetBufferSetL ength( _MAX_PATH ), _MAX_PATH );
GetCurrentDirectory( strDirectory.GetBufferSetL
just curious.. why you don't want to use GetCurrentDirectory..
Just set the length argumnet as MAX_FILE or you can say 255