Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDetecting file association changes and getting new icon Pin
Defenestration9-May-05 20:18
Defenestration9-May-05 20:18 
QuestionHow to chage attributes for a directory? Pin
hfrmobile9-May-05 19:50
hfrmobile9-May-05 19:50 
AnswerRe: How to chage attributes for a directory? Pin
David Crow10-May-05 2:19
David Crow10-May-05 2:19 
GeneralRe: How to chage attributes for a directory? Pin
hfrmobile10-May-05 3:22
hfrmobile10-May-05 3:22 
GeneralRe: How to chage attributes for a directory? Pin
David Crow10-May-05 4:46
David Crow10-May-05 4:46 
GeneralRe: How to chage attributes for a directory? Pin
hfrmobile10-May-05 5:08
hfrmobile10-May-05 5:08 
GeneralRe: How to chage attributes for a directory? Pin
David Crow10-May-05 5:15
David Crow10-May-05 5:15 
GeneralRe: How to chage attributes for a directory? Pin
hfrmobile10-May-05 9:05
hfrmobile10-May-05 9:05 
Very interesting... thx!

This code (see comments) demonstrates what happens:

<br />
CeRapiInit();<br />
<br />
// "\\CF-Card\\Temp"<br />
// "\\SD-MMCard\\Temp"<br />
// "\\Temp\\Test"<br />
CString strFileName = "\\SD-MMCard\\Temp";<br />
<br />
wchar_t wcFileName[256];<br />
mbstowcs(wcFileName, strFileName, strFileName.GetLength()+1);<br />
<br />
DWORD dwAttributes = CeGetFileAttributes(wcFileName); // works always<br />
HRESULT hr = CeGetLastError();<br />
<br />
dwAttributes |= FILE_ATTRIBUTE_READONLY;<br />
<br />
// hr = 0x00000002 "The system cannot find the file specified." if dir is in RAM<br />
// hr = 0x00000005 "Access is denied." if dir is on storage card<br />
// this problems only occur using RAPI<br />
CeSetFileAttributes(wcFileName, dwAttributes);<br />
hr = CeGetLastError();<br />
<br />
CeRapiUninit();<br />


RAM: "The system cannot find the file specified." (ok, since MSDN says it is not supported

Storage Cards: "Access is denied." (also not supported?Cry | :(( )
GeneralRe: How to chage attributes for a directory? Pin
hfrmobile12-May-05 21:00
hfrmobile12-May-05 21:00 
GeneralDTW Pin
Jaymahinda9-May-05 18:39
Jaymahinda9-May-05 18:39 
Generalabout &quot;delete&quot; Pin
simon wan9-May-05 15:56
simon wan9-May-05 15:56 
GeneralRe: about &quot;delete&quot; Pin
PJ Arends9-May-05 16:09
professionalPJ Arends9-May-05 16:09 
GeneralRe: about &quot;delete&quot; Pin
Jörgen Sigvardsson10-May-05 1:46
Jörgen Sigvardsson10-May-05 1:46 
GeneralRe: about &quot;delete&quot; Pin
Nemanja Trifunovic10-May-05 3:58
Nemanja Trifunovic10-May-05 3:58 
GeneralRe: about "delete" Pin
hfrmobile12-May-05 21:05
hfrmobile12-May-05 21:05 
GeneralRe: about &quot;delete&quot; Pin
Nemanja Trifunovic13-May-05 3:56
Nemanja Trifunovic13-May-05 3:56 
GeneralRe: about &quot;delete&quot; Pin
hfrmobile16-May-05 20:35
hfrmobile16-May-05 20:35 
Generaljust finished my 2d game engine Pin
tom_dx9-May-05 14:56
tom_dx9-May-05 14:56 
GeneralRe: just finished my 2d game engine Pin
Christian Graus9-May-05 15:22
protectorChristian Graus9-May-05 15:22 
GeneralRe: just finished my 2d game engine Pin
tom_dx10-May-05 12:20
tom_dx10-May-05 12:20 
GeneralLooking for calendar control Pin
David Crow9-May-05 10:20
David Crow9-May-05 10:20 
GeneralRe: Looking for calendar control Pin
Ravi Bhavnani9-May-05 10:46
professionalRavi Bhavnani9-May-05 10:46 
GeneralRe: Looking for calendar control Pin
David Crow10-May-05 2:11
David Crow10-May-05 2:11 
GeneralRe: Looking for calendar control Pin
Ravi Bhavnani10-May-05 2:13
professionalRavi Bhavnani10-May-05 2:13 
GeneralPrint menu selection Pin
Member 19632089-May-05 9:10
Member 19632089-May-05 9:10 

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.