Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFtpConnection ???? Pin
racing573-Aug-06 22:57
racing573-Aug-06 22:57 
GeneralRe: CFtpConnection ???? Pin
David Crow4-Aug-06 2:31
David Crow4-Aug-06 2:31 
GeneralRe: CFtpConnection ???? Pin
racing574-Aug-06 3:15
racing574-Aug-06 3:15 
GeneralRe: CFtpConnection ???? Pin
racing574-Aug-06 3:22
racing574-Aug-06 3:22 
GeneralRe: CFtpConnection ???? Pin
racing5715-Aug-06 4:14
racing5715-Aug-06 4:14 
QuestionWriting different language into VC6 Pin
Stan the man3-Aug-06 5:20
Stan the man3-Aug-06 5:20 
AnswerRe: Writing different language into VC6 Pin
Ștefan-Mihai MOGA3-Aug-06 14:00
professionalȘtefan-Mihai MOGA3-Aug-06 14:00 
QuestionKeeping an MDI file locked with CFile::shareExclusive Pin
bob169723-Aug-06 4:50
bob169723-Aug-06 4:50 
(VC++ 6.0 MFC MDI application)
I'm attempting to add file in use functionality to a MFC MDI application for the life of a CDocument. By default, the CDocument appears to lock the file only during serialization then it releases the file. I need to provide functionality not unlike MS Word where it remains locked during editting.

Just for proof of concept, to just see it work, and later make it a little bit more robust, I was providing implementation for OnOpenDocument, OnSaveDocument, and OnCloseDocument with the original MFC code in them. I made whatever modifications needed to prevent CDocument::ReleaseFile from being called while the file was open and I put a member variable in the CDocument class m_pFile to use to assist in keeping that file locked and open. I'm checking the lpszPathName against GetPathName() to determine when to use the stored pointer versus cleaning it up/closing and getting a new file/pointer.

The files get locked as expected but file Open/Save-SaveAs doesn't modify the file (A temporary file gets created/destroyed during the attempt). Only a New/Save-SaveAs (with a unique name) puts the serialized data into the file. Any ideas or has anyone successfully did this in an MDI app without ripping too much out to do it?



AnswerRe: Keeping an MDI file locked with CFile::shareExclusive Pin
Viorel.3-Aug-06 5:13
Viorel.3-Aug-06 5:13 
GeneralRe: Keeping an MDI file locked with CFile::shareExclusive Pin
bob169723-Aug-06 5:47
bob169723-Aug-06 5:47 
Questionneed good idea of print-preview Pin
includeh103-Aug-06 4:42
includeh103-Aug-06 4:42 
AnswerRe: need good idea of print-preview Pin
bob169723-Aug-06 4:59
bob169723-Aug-06 4:59 
GeneralRe: need good idea of print-preview Pin
includeh103-Aug-06 8:14
includeh103-Aug-06 8:14 
AnswerRe: need good idea of print-preview Pin
Hamid_RT4-Aug-06 7:02
Hamid_RT4-Aug-06 7:02 
QuestionWinsock - Multicasting with CCESocket [modified] Pin
king minger3-Aug-06 4:27
king minger3-Aug-06 4:27 
NewsRe: Winsock - Multicasting with CCESocket [modified] Pin
king minger3-Aug-06 5:08
king minger3-Aug-06 5:08 
AnswerRe: Winsock - Multicasting with CCESocket Pin
king minger4-Aug-06 1:26
king minger4-Aug-06 1:26 
QuestionDeclaring Array Variable for a Class [modified] Pin
Andy Rama3-Aug-06 4:16
Andy Rama3-Aug-06 4:16 
AnswerRe: Declaring Array Variable for a Class Pin
David Crow3-Aug-06 4:22
David Crow3-Aug-06 4:22 
GeneralRe: Declaring Array Variable for a Class Pin
Andy Rama3-Aug-06 8:43
Andy Rama3-Aug-06 8:43 
QuestionRe: Declaring Array Variable for a Class Pin
David Crow4-Aug-06 2:32
David Crow4-Aug-06 2:32 
QuestionRe: Declaring Array Variable for a Class Pin
Andy Rama4-Aug-06 2:51
Andy Rama4-Aug-06 2:51 
AnswerRe: Declaring Array Variable for a Class Pin
David Crow4-Aug-06 2:59
David Crow4-Aug-06 2:59 
AnswerRe: Declaring Array Variable for a Class Pin
Zac Howland3-Aug-06 5:01
Zac Howland3-Aug-06 5:01 
GeneralRe: Declaring Array Variable for a Class Pin
Andy Rama3-Aug-06 19:31
Andy Rama3-Aug-06 19:31 

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.