Click here to Skip to main content
15,890,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCListCtrl Button Pin
rlepine10-Feb-05 4:11
rlepine10-Feb-05 4:11 
GeneralRe: CListCtrl Button Pin
rocky_pulley10-Feb-05 5:04
rocky_pulley10-Feb-05 5:04 
GeneralRe: CListCtrl Button Pin
rlepine10-Feb-05 5:20
rlepine10-Feb-05 5:20 
Generalmsxml 3.0 , used for xml creation , error description Pin
cj_rahul10-Feb-05 3:49
cj_rahul10-Feb-05 3:49 
GeneralRe: msxml 3.0 , used for xml creation , error description Pin
ThatsAlok10-Feb-05 18:54
ThatsAlok10-Feb-05 18:54 
QuestionHow To Get know if Directory Exists? Pin
Rassul Yunussov9-Feb-05 23:37
Rassul Yunussov9-Feb-05 23:37 
AnswerRe: How To Get know if Directory Exists? Pin
Chris Losinger10-Feb-05 3:52
professionalChris Losinger10-Feb-05 3:52 
AnswerRe: How To Get know if Directory Exists? Pin
Blake Miller10-Feb-05 4:18
Blake Miller10-Feb-05 4:18 
There is a fundamental problem with only using the _access method described earlier, it is POSSIBLE that you are looking at a FILE with the name 'fdsa' in the 'asdf' folder! You should ALWAYS verify that it exists AND it is a directory, if that is your true requirement!

<br />
// get attributes<br />
DWORD dwAttributes = GetFileAttributes("C:\\asdf\\fdsa");<br />
<br />
// if value is -1, it does not exist<br />
if( dwAttributes != (DWORD)-1 ){<br />
<br />
  // make sure it is directory and NOT a file...<br />
  if( dwAttributes & FILE_ATTRIBUTE_DIRECTORY ){<br />
    // you are okay, it exists AND it is a directory<br />
  } else {<br />
    // could be a problem - a file 'C:\asdf\fdsa' is sitting there - NOT a folder<br />
  }<br />
<br />
} else {<br />
<br />
  // nothing is there go ahead and create your folder now...<br />
  // although the TRULY paranoid of you will verify that C:\asdf<br />
  // is TRULY a folder at this point...<br />
  dwAttributes = GetFileAttributes("C:\\asdf");<br />
<br />
  if( dwAttributes != (DWORD)-1 ){<br />
    // make sure it is directory and NOT a file...<br />
    if( dwAttributes & FILE_ATTRIBUTE_DIRECTORY ){<br />
      // you are okay, it exists AND it is a directory<br />
      // C:\asdf is an existing folder, so go ahead and create C:\asdf\fdsa<br />
    } else {<br />
      // could be a problem - a file 'C:\asdf' is sitting there - NOT a folder<br />
    }  <br />
  } else {<br />
    // C:\asdf missing too, so go ahead and create C:\asdf<br />
    // and then create C:\asdf\fdsa<br />
  }<br />
}<br />


...and you wanted to write robust software... Sigh | :sigh:
AnswerRe: How To Get know if Directory Exists? Pin
Ravi Bhavnani10-Feb-05 6:44
professionalRavi Bhavnani10-Feb-05 6:44 
AnswerRe: How To Get know if Directory Exists? Pin
Michael Dunn10-Feb-05 10:16
sitebuilderMichael Dunn10-Feb-05 10:16 
GeneralHelp in adding a new display mode!!!Crazy Pin
uday__m9-Feb-05 23:15
uday__m9-Feb-05 23:15 
Questionhow to pack bitmaps in a dll Pin
Anonymous9-Feb-05 23:02
Anonymous9-Feb-05 23:02 
AnswerRe: how to pack bitmaps in a dll Pin
2249179-Feb-05 23:07
2249179-Feb-05 23:07 
GeneralUDP message reply Pin
Anonymous9-Feb-05 22:58
Anonymous9-Feb-05 22:58 
Generalsorting elements in double pointer Pin
tttyip9-Feb-05 20:35
tttyip9-Feb-05 20:35 
GeneralRe: sorting elements in double pointer Pin
David Crow10-Feb-05 9:26
David Crow10-Feb-05 9:26 
GeneralRe: sorting elements in double pointer Pin
tttyip22-Feb-05 2:32
tttyip22-Feb-05 2:32 
GeneralRe: sorting elements in double pointer Pin
David Crow22-Feb-05 3:36
David Crow22-Feb-05 3:36 
GeneralVisual Studio .Net hangs system during debugging. Pin
Brian van der Beek9-Feb-05 20:03
Brian van der Beek9-Feb-05 20:03 
GeneralRe: Visual Studio .Net hangs system during debugging. Pin
2249179-Feb-05 21:34
2249179-Feb-05 21:34 
GeneralRe: Visual Studio .Net hangs system during debugging. Pin
Joel Lucsy13-Feb-05 14:29
Joel Lucsy13-Feb-05 14:29 
GeneralShellExecute, it is not working Pin
Aqueel9-Feb-05 19:17
Aqueel9-Feb-05 19:17 
GeneralRe: ShellExecute, it is not working Pin
Blake Miller10-Feb-05 4:46
Blake Miller10-Feb-05 4:46 
GeneralRe: ShellExecute, it is not working Pin
Aqueel10-Feb-05 16:31
Aqueel10-Feb-05 16:31 
GeneralRe: ShellExecute, it is not working Pin
Yulianto.10-Feb-05 16:48
Yulianto.10-Feb-05 16:48 

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.