Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionsave results in xml Pin
lavy288312-May-07 0:31
lavy288312-May-07 0:31 
AnswerRe: save results in xml Pin
Mark Salsbery12-May-07 5:22
Mark Salsbery12-May-07 5:22 
AnswerRe: save results in xml Pin
Hamid_RT12-May-07 6:07
Hamid_RT12-May-07 6:07 
AnswerRe: save results in xml Pin
S Douglas13-May-07 2:08
professionalS Douglas13-May-07 2:08 
QuestionOpen() function not opening file Pin
neha.agarwal2711-May-07 23:50
neha.agarwal2711-May-07 23:50 
AnswerRe: Open() function not opening file Pin
Rajesh R Subramanian12-May-07 0:15
professionalRajesh R Subramanian12-May-07 0:15 
GeneralRe: Open() function not opening file Pin
neha.agarwal2712-May-07 0:23
neha.agarwal2712-May-07 0:23 
GeneralRe: Open() function not opening file Pin
Rajesh R Subramanian12-May-07 0:34
professionalRajesh R Subramanian12-May-07 0:34 
neha.agarwal27 wrote:
but still not opening file.

What exactly does that mean? Is CStdioFile.Open() returning zero? Why are you passing a NULL to the Open()command then? Use file exception. Try the following code snippet and find out what the problem is...
CStdioFile test_ptr;
CString File_name = _T("C:\\MyFile.txt"), strTemp;
int iRetCode;
CFileException e;

iRetCode = _access(File_name, 6);
strTemp.Format(_T("_access function returned %d"), iRetCode);
AfxMessageBox(strTemp);

iRetCode = test_ptr.Open(File_name, CFile::modeReadWrite, &e);
if ( !iRetCode )
{
    e.GetErrorMessage(strTemp.GetBuffer(MAX_PATH), MAX_PATH, NULL);
    AfxMessageBox(strTemp);
    strTemp.ReleaseBuffer(-1);
}
else
{
    strTemp.Format(_T("CStdioFile.Open() function returned %d"), iRetCode);
    AfxMessageBox(strTemp);
}





Anything I will say you will bring it down to whatever you want.

 

QuestionQueue Pin
tamer hasasn11-May-07 23:47
tamer hasasn11-May-07 23:47 
AnswerRe: Queue Pin
Christian Graus12-May-07 0:07
protectorChristian Graus12-May-07 0:07 
AnswerRe: Queue Pin
Stephen Hewitt13-May-07 15:13
Stephen Hewitt13-May-07 15:13 
QuestionHow to add a file list box in SHBrowseOfFolder() dialog? Pin
zhongwenjia11-May-07 23:28
zhongwenjia11-May-07 23:28 
AnswerRe: How to add a file list box in SHBrowseOfFolder() dialog? Pin
Mark Salsbery12-May-07 5:35
Mark Salsbery12-May-07 5:35 
QuestionIP address control Pin
prathuraj11-May-07 20:39
prathuraj11-May-07 20:39 
AnswerRe: IP address control Pin
TariqZ11-May-07 21:20
TariqZ11-May-07 21:20 
GeneralRe: IP address control Pin
Member 1308982521-Apr-17 0:21
Member 1308982521-Apr-17 0:21 
QuestionLow-level(byte-level) Duplicating Pin
Fouad_kayali11-May-07 20:09
Fouad_kayali11-May-07 20:09 
AnswerRe: Low-level(byte-level) Duplicating Pin
TariqZ11-May-07 21:24
TariqZ11-May-07 21:24 
Questioninsert excel datas in mysql db Pin
vijay_8311-May-07 19:33
vijay_8311-May-07 19:33 
AnswerRe: insert excel datas in mysql db Pin
Rajesh R Subramanian12-May-07 0:22
professionalRajesh R Subramanian12-May-07 0:22 
GeneralRe: insert excel datas in mysql db Pin
vijay_8312-May-07 1:56
vijay_8312-May-07 1:56 
QuestionCreateProcess and WaitForSingleObject Pin
cppshishu11-May-07 18:57
cppshishu11-May-07 18:57 
AnswerRe: CreateProcess and WaitForSingleObject Pin
Mark Salsbery12-May-07 5:43
Mark Salsbery12-May-07 5:43 
QuestionStorage class for MD5 values Pin
TariqZ11-May-07 18:39
TariqZ11-May-07 18:39 
AnswerRe: Storage class for MD5 values Pin
Garth J Lancaster11-May-07 19:27
professionalGarth J Lancaster11-May-07 19:27 

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.