Click here to Skip to main content
15,907,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Transparent background and colored text for radio button Pin
Paresh Chitte11-Mar-10 18:18
Paresh Chitte11-Mar-10 18:18 
AnswerRe: Transparent background and colored text for radio button Pin
Mohan Ramachandra11-Mar-10 18:48
Mohan Ramachandra11-Mar-10 18:48 
AnswerRe: Transparent background and colored text for radio button Pin
KarstenK11-Mar-10 21:54
mveKarstenK11-Mar-10 21:54 
QuestionHow can send SMS in PDU mode by using AT commands? Pin
Le@rner11-Mar-10 17:27
Le@rner11-Mar-10 17:27 
QuestionColor For List View Control Column Pin
hellogany11-Mar-10 16:47
hellogany11-Mar-10 16:47 
AnswerRe: Color For List View Control Column Pin
chevu11-Mar-10 17:21
chevu11-Mar-10 17:21 
AnswerRe: Color For List View Control Column Pin
Naveen11-Mar-10 18:14
Naveen11-Mar-10 18:14 
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 

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.