Click here to Skip to main content
15,915,513 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Book Recommendation Pin
Hamid_RT7-Dec-06 18:18
Hamid_RT7-Dec-06 18:18 
GeneralRe: Book Recommendation Pin
ThatsAlok7-Dec-06 18:29
ThatsAlok7-Dec-06 18:29 
GeneralRe: Book Recommendation Pin
Hamid_RT7-Dec-06 18:51
Hamid_RT7-Dec-06 18:51 
AnswerRe: Book Recommendation Pin
Hamid_RT7-Dec-06 17:55
Hamid_RT7-Dec-06 17:55 
Questionloading an image Pin
Sunil P V7-Dec-06 2:29
Sunil P V7-Dec-06 2:29 
AnswerRe: loading an image Pin
Chris Losinger7-Dec-06 8:32
professionalChris Losinger7-Dec-06 8:32 
AnswerRe: loading an image Pin
Hamid_RT7-Dec-06 17:59
Hamid_RT7-Dec-06 17:59 
QuestionCFile does not open Pin
BadJerry7-Dec-06 2:27
BadJerry7-Dec-06 2:27 
Here is the following code part of a COM object (in Visual C++ 6.0)

<br />
   CFile filXML;<br />
   CFileException e;<br />
   if ( !filXML.Open(strFile,CFile::modeCreate | CFile::modeWrite | CFile::typeBinary,&e ) )<br />
   {<br />
      TCHAR lpError[256];<br />
      e.GetErrorMessage(lpError,255);<br />
      // Cannot open file<br />
      CString strError;<br />
      strError.Format(_T("Cannot create file '%s' Cause:%d OS error:%ld Error:'%s'"),strFile,e.m_cause,e.m_lOsError,lpError);<br />
<br />
      if ( pstrError != NULL )<br />
      {<br />
         if ( (*pstrError) != NULL )<br />
            SysFreeString(*pstrError);<br />
         *pstrError = strError.AllocSysString();<br />
      }<br />
<br />
      *pnResult = ERR_CANNOT_CREATE_FILE;<br />
      return S_OK;<br />
   }<br />
<br />


This has always worked. On one installation (called by an ASP.net application) CFile::Open returns false except I get 0 for the cause and -1 for the OS error. The file name seems fine (asp.net can create a file of that name)
Any idea why?
AnswerRe: CFile does not open Pin
prasad_som7-Dec-06 2:39
prasad_som7-Dec-06 2:39 
GeneralRe: CFile does not open Pin
BadJerry7-Dec-06 2:45
BadJerry7-Dec-06 2:45 
GeneralRe: CFile does not open Pin
prasad_som7-Dec-06 3:12
prasad_som7-Dec-06 3:12 
GeneralRe: CFile does not open Pin
BadJerry7-Dec-06 4:54
BadJerry7-Dec-06 4:54 
GeneralRe: CFile does not open Pin
prasad_som7-Dec-06 18:22
prasad_som7-Dec-06 18:22 
AnswerRe: CFile does not open Pin
Mark Salsbery7-Dec-06 5:44
Mark Salsbery7-Dec-06 5:44 
QuestionTypecasting incompatible types Pin
WillemM7-Dec-06 2:22
WillemM7-Dec-06 2:22 
AnswerRe: Typecasting incompatible types Pin
Mark Salsbery7-Dec-06 5:57
Mark Salsbery7-Dec-06 5:57 
GeneralRe: Typecasting incompatible types Pin
WillemM7-Dec-06 6:26
WillemM7-Dec-06 6:26 
GeneralRe: Typecasting incompatible types Pin
Mark Salsbery7-Dec-06 6:43
Mark Salsbery7-Dec-06 6:43 
GeneralRe: Typecasting incompatible types Pin
WillemM7-Dec-06 6:44
WillemM7-Dec-06 6:44 
GeneralRe: Typecasting incompatible types Pin
Mark Salsbery7-Dec-06 6:51
Mark Salsbery7-Dec-06 6:51 
AnswerRe: Typecasting incompatible types [modified] Pin
Stephen Hewitt7-Dec-06 11:52
Stephen Hewitt7-Dec-06 11:52 
QuestionBackup & Recovery Utility for MS Exchange Pin
Vinay Jain7-Dec-06 2:12
Vinay Jain7-Dec-06 2:12 
Questionhighlight list control items using mouse Pin
YaronNir7-Dec-06 2:06
YaronNir7-Dec-06 2:06 
AnswerRe: highlight list control items using mouse Pin
Sunil P V7-Dec-06 2:28
Sunil P V7-Dec-06 2:28 
Questionload image Pin
Sunil P V7-Dec-06 1:34
Sunil P V7-Dec-06 1:34 

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.