Click here to Skip to main content
15,902,738 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: newbie - compile c code to work with c++ code Pin
timverb17-Jul-08 16:21
timverb17-Jul-08 16:21 
GeneralRe: newbie - compile c code to work with c++ code Pin
David Crow18-Jul-08 9:05
David Crow18-Jul-08 9:05 
GeneralRe: newbie - compile c code to work with c++ code Pin
timverb18-Jul-08 9:38
timverb18-Jul-08 9:38 
AnswerRe: newbie - compile c code to work with c++ code Pin
Alan Balkany17-Jul-08 3:54
Alan Balkany17-Jul-08 3:54 
General[Message Deleted] Pin
timverb17-Jul-08 11:35
timverb17-Jul-08 11:35 
GeneralRe: newbie - compile c code to work with c++ code Pin
Alan Balkany17-Jul-08 11:38
Alan Balkany17-Jul-08 11:38 
GeneralRe: newbie - compile c code to work with c++ code [modified] Pin
timverb17-Jul-08 16:17
timverb17-Jul-08 16:17 
GeneralRe: newbie - compile c code to work with c++ code Pin
Alan Balkany18-Jul-08 3:31
Alan Balkany18-Jul-08 3:31 
GeneralRe: newbie - compile c code to work with c++ code Pin
timverb18-Jul-08 9:36
timverb18-Jul-08 9:36 
QuestionAccess Denied Error Pin
Larry Mills Sr16-Jul-08 8:40
Larry Mills Sr16-Jul-08 8:40 
AnswerRe: Access Denied Error Pin
Cedric Moonen16-Jul-08 8:42
Cedric Moonen16-Jul-08 8:42 
GeneralRe: Access Denied Error Pin
Larry Mills Sr16-Jul-08 9:20
Larry Mills Sr16-Jul-08 9:20 
GeneralRe: Access Denied Error Pin
Perspx16-Jul-08 10:00
Perspx16-Jul-08 10:00 
GeneralRe: Access Denied Error Pin
led mike16-Jul-08 10:42
led mike16-Jul-08 10:42 
GeneralRe: Access Denied Error Pin
Larry Mills Sr16-Jul-08 11:19
Larry Mills Sr16-Jul-08 11:19 
GeneralRe: Access Denied Error Pin
Mark Salsbery16-Jul-08 12:14
Mark Salsbery16-Jul-08 12:14 
GeneralRe: Access Denied Error Pin
led mike16-Jul-08 12:18
led mike16-Jul-08 12:18 
GeneralRe: Access Denied Error Pin
Larry Mills Sr16-Jul-08 13:51
Larry Mills Sr16-Jul-08 13:51 
GeneralRe: Access Denied Error Pin
Mark Salsbery16-Jul-08 14:13
Mark Salsbery16-Jul-08 14:13 
GeneralRe: Access Denied Error Pin
Larry Mills Sr17-Jul-08 17:55
Larry Mills Sr17-Jul-08 17:55 
While I was waiting for some answers I did this. Remember you showed me about this:
if(!myFile.Open(m_csFileName, CFile::modeNoTruncate | CFile::modeCreate | CFile::modeReadWrite | CFile::shareDenyWrite | CFile::typeText, &ex))
{
TCHAR szError[1024];
ex.GetErrorMessage(szError, 1024);
AfxMessageBox(szError, MB_OK, 0);
return;
}

I have a function that creates all the directories the program uses called SetDir(); I did this:

======================================================================================================================================
CString s;
if(!myFile.Open(m_csFileName, CFile::modeNoTruncate | CFile::modeCreate | CFile::modeReadWrite | CFile::shareDenyWrite | CFile::typeText, &ex))
{
TCHAR szError[1024];
ex.GetErrorMessage(szError, 1024);
//AfxMessageBox(szError, MB_OK, 0);
// I know I'll get the PATH_NOT_FOUND error
SetDir();
s = _T("Done");
FileSaveDir(s); // s will be written to the already known filename
return;
}
=====================================================================================================================================
It creates all the directories and also creates the file. I placed this in The programs application function InitInstance() right after the call for ShowWindow(). everything works fine. Your approach is probally best, but I don't know what all that stuff is. I'll find out though!

A C++ programming language novice, but striving to learn
GeneralRe: Access Denied Error Pin
led mike16-Jul-08 12:17
led mike16-Jul-08 12:17 
Questionhowto Post Message Pin
aei_totten16-Jul-08 7:52
aei_totten16-Jul-08 7:52 
AnswerRe: howto Post Message Pin
Cedric Moonen16-Jul-08 8:06
Cedric Moonen16-Jul-08 8:06 
GeneralRe: howto Post Message Pin
Stephen Hewitt16-Jul-08 13:09
Stephen Hewitt16-Jul-08 13:09 
GeneralRe: howto Post Message Pin
Cedric Moonen16-Jul-08 20:36
Cedric Moonen16-Jul-08 20:36 

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.