Click here to Skip to main content
15,892,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC Drag drop Target line Pin
RakeshManohar11-Mar-10 16:40
RakeshManohar11-Mar-10 16:40 
AnswerRe: MFC Drag drop Target line Pin
Iain Clarke, Warrior Programmer11-Mar-10 22:06
Iain Clarke, Warrior Programmer11-Mar-10 22:06 
QuestionWhich licensing software to use. Pin
wattsupdoc11-Mar-10 16:31
wattsupdoc11-Mar-10 16:31 
AnswerRe: Which licensing software to use. Pin
wattsupdoc12-Mar-10 17:10
wattsupdoc12-Mar-10 17:10 
QuestionCreating File at startup error Pin
Zacory11-Mar-10 16:22
Zacory11-Mar-10 16:22 
AnswerRe: Creating File at startup error Pin
Stephen Hewitt11-Mar-10 16:36
Stephen Hewitt11-Mar-10 16:36 
GeneralRe: Creating File at startup error Pin
Zacory11-Mar-10 16:56
Zacory11-Mar-10 16:56 
AnswerRe: Creating File at startup error [modified] Pin
Mohan Ramachandra11-Mar-10 18:36
Mohan Ramachandra11-Mar-10 18:36 
Zacory wrote:
file.open("test.txt", ios::out);


Give the absolute path while opening or creating the file. Use GetModuleFileName() function to create absolute path.

CString strPath;
	char *pChPath=strPath.GetBuffer(_MAX_PATH);	
	GetModuleFileName(NULL,pChPath,_MAX_PATH);
	strPath.ReleaseBuffer(_MAX_PATH);
	int nPos=strPath.ReverseFind('\\');

	strPath = strPath.Mid(0,nPos+1);
	strPath+="test.txt";
	pChPath = strPath.GetBuffer(_MAX_PATH);
	// Use this absolute path
	MessageBox(pChPath);
	strPath.ReleaseBuffer(_MAX_PATH);

This issue you are facing only in Start up because, the current working directory of the exe is not the actual path where the exe is located.
modified on Monday, March 22, 2010 5:32 AM

GeneralRe: Creating File at startup error Pin
Zacory11-Mar-10 19:10
Zacory11-Mar-10 19:10 
GeneralRe: Creating File at startup error Pin
Mohan Ramachandra11-Mar-10 19:19
Mohan Ramachandra11-Mar-10 19:19 
QuestionHow to check memory how many? Pin
Patrick Tang11-Mar-10 16:05
Patrick Tang11-Mar-10 16:05 
GeneralRe: How to check memory how many? Pin
chevu11-Mar-10 17:23
chevu11-Mar-10 17:23 
GeneralRe: How to check memory how many? Pin
Patrick Tang11-Mar-10 20:39
Patrick Tang11-Mar-10 20:39 
GeneralRe: How to check memory how many? Pin
Richard MacCutchan11-Mar-10 21:52
mveRichard MacCutchan11-Mar-10 21:52 
Questionconfused MFC CREATING CLASS AND MESSASE HANDLE Pin
acce5511-Mar-10 14:56
acce5511-Mar-10 14:56 
AnswerRe: confused MFC CREATING CLASS AND MESSASE HANDLE Pin
chevu11-Mar-10 17:27
chevu11-Mar-10 17:27 
AnswerRe: confused MFC CREATING CLASS AND MESSASE HANDLE Pin
David Crow12-Mar-10 3:05
David Crow12-Mar-10 3:05 
Questionbuild error while compiling log4cpp using visual studio .net 2003 Pin
deardyg11-Mar-10 12:33
deardyg11-Mar-10 12:33 
AnswerRe: build error while compiling log4cpp using visual studio .net 2003 Pin
Stuart Dootson11-Mar-10 16:26
professionalStuart Dootson11-Mar-10 16:26 
QuestionHello how should i use the this pointer if it is a function param as void *this Pin
nah133711-Mar-10 11:16
nah133711-Mar-10 11:16 
AnswerRe: Hello how should i use the this pointer if it is a function param as void *this Pin
Jonathan Davies11-Mar-10 12:21
Jonathan Davies11-Mar-10 12:21 
AnswerRe: Hello how should i use the this pointer if it is a function param as void *this Pin
zhq0000111-Mar-10 14:25
zhq0000111-Mar-10 14:25 
GeneralRe: Hello how should i use the this pointer if it is a function param as void *this Pin
Jonathan Davies12-Mar-10 0:01
Jonathan Davies12-Mar-10 0:01 
AnswerRe: Hello how should i use the this pointer if it is a function param as void *this Pin
Stephen Hewitt11-Mar-10 14:41
Stephen Hewitt11-Mar-10 14:41 
GeneralRe: Hello how should i use the this pointer if it is a function param as void *this Pin
nah133711-Mar-10 19:11
nah133711-Mar-10 19:11 

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.