Click here to Skip to main content
15,925,206 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC CDocManger - OnFileNew() Pin
Vaclav_11-Oct-06 16:26
Vaclav_11-Oct-06 16:26 
AnswerRe: MFC CDocManger - OnFileNew() Pin
PJ Arends11-Oct-06 20:29
professionalPJ Arends11-Oct-06 20:29 
GeneralRe: MFC CDocManger - OnFileNew() Pin
Vaclav_12-Oct-06 6:29
Vaclav_12-Oct-06 6:29 
Questionhow to save an big array as an image? Pin
zhijia.yuan11-Oct-06 10:54
zhijia.yuan11-Oct-06 10:54 
AnswerRe: how to save an big array as an image? Pin
Mark Salsbery11-Oct-06 12:33
Mark Salsbery11-Oct-06 12:33 
AnswerRe: how to save an big array as an image? Pin
David Crow12-Oct-06 2:54
David Crow12-Oct-06 2:54 
QuestionCookie problem with IWebBrowser2 Pin
ayol1212211-Oct-06 10:29
ayol1212211-Oct-06 10:29 
QuestionChanging file share attributes in a CFile object Pin
stretchcoder11-Oct-06 10:20
stretchcoder11-Oct-06 10:20 
I am opening a file in readwrite and shareexclusive mode, but later want to change this to different access and share modes, but can't figure out how to do it. I tried using SetStatus but it doesn't seem to work (I think I don't know how to set the m_attributes correctly)... I am currently closing the file and reopening it, which feels like a cludge to me! Any suggestions?

First time opening file:
CFile writeFile;
writeFile.Open(curFile, CFile::modeCreate | CFile::modeReadWrite | CFile::shareExclusive, &fileException)

Then I close and reopen:
writeFile.Close();
writeFile.Open(curFile, CFile::modeRead | CFile::shareDenyWrite, &fileException);


The SetStatus code that is NOT working is:
CFileStatus status;
writeFile.GetStatus( status );
status.m_attribute = status.m_attribute | writeFile.readOnly;
writeFile.SetStatus( curFile, status );


Thanks in advance!
AnswerRe: Changing file share attributes in a CFile object Pin
Mark Salsbery11-Oct-06 12:49
Mark Salsbery11-Oct-06 12:49 
GeneralRe: Changing file share attributes in a CFile object Pin
stretchcoder11-Oct-06 13:42
stretchcoder11-Oct-06 13:42 
GeneralRe: Changing file share attributes in a CFile object Pin
Mark Salsbery11-Oct-06 13:50
Mark Salsbery11-Oct-06 13:50 
QuestionSTL iterator Pin
act_x11-Oct-06 9:41
act_x11-Oct-06 9:41 
AnswerRe: STL iterator Pin
cje11-Oct-06 11:21
cje11-Oct-06 11:21 
AnswerRe: STL iterator Pin
markkuk11-Oct-06 12:47
markkuk11-Oct-06 12:47 
AnswerRe: STL iterator Pin
User 58385211-Oct-06 16:28
User 58385211-Oct-06 16:28 
GeneralRe: STL iterator Pin
act_x11-Oct-06 19:58
act_x11-Oct-06 19:58 
GeneralRe: STL iterator Pin
User 58385211-Oct-06 20:02
User 58385211-Oct-06 20:02 
QuestionDrag and drop files and folders Pin
kiranin11-Oct-06 9:20
kiranin11-Oct-06 9:20 
AnswerRe: Drag and drop files and folders Pin
Mark Salsbery11-Oct-06 9:41
Mark Salsbery11-Oct-06 9:41 
GeneralRe: Drag and drop files and folders Pin
kiranin11-Oct-06 19:15
kiranin11-Oct-06 19:15 
GeneralRe: Drag and drop files and folders Pin
Hamid_RT12-Oct-06 7:24
Hamid_RT12-Oct-06 7:24 
QuestionMenus creation problem Pin
Alex Cutovoi11-Oct-06 6:51
Alex Cutovoi11-Oct-06 6:51 
AnswerRe: Menus creation problem Pin
Alex Cutovoi11-Oct-06 8:22
Alex Cutovoi11-Oct-06 8:22 
AnswerRe: Menus creation problem Pin
Sachinpatole11-Oct-06 19:59
Sachinpatole11-Oct-06 19:59 
QuestionRead CSV File, C++/MFC Pin
JBAK_CP11-Oct-06 6:46
JBAK_CP11-Oct-06 6:46 

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.