Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
lctrncs18-Dec-06 6:01
lctrncs18-Dec-06 6:01 
GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
Mark Salsbery18-Dec-06 7:39
Mark Salsbery18-Dec-06 7:39 
GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
lctrncs18-Dec-06 11:51
lctrncs18-Dec-06 11:51 
GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
Mark Salsbery15-Dec-06 8:59
Mark Salsbery15-Dec-06 8:59 
GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
Mark Salsbery14-Dec-06 16:18
Mark Salsbery14-Dec-06 16:18 
AnswerRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
Stephen Hewitt12-Dec-06 12:03
Stephen Hewitt12-Dec-06 12:03 
GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
lctrncs13-Dec-06 6:09
lctrncs13-Dec-06 6:09 
GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
lctrncs13-Dec-06 7:45
lctrncs13-Dec-06 7:45 
Thank you for the nice clue.

Including a CreateFile function passing a dwSharedMode 0 in my OnOpenDocument allows me to open a file when I use the lpszPathName of OnOpenDocument as the first argument in the CreateFile function.

If I then try to open the file a second time using a different instance of my app, a "sharing violation" message appears.

If I try to save the first instance of the file using the first instance of my app, a First Chance Exception occurs that passes "access denied" back to the program.

I have tried various file attributes, but am probably doing something more basic wrong.

Any suggestions?






"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash

GeneralRe: Multiple application instances-how prevent multiple file instances or file overwrite Pin
Stephen Hewitt13-Dec-06 10:15
Stephen Hewitt13-Dec-06 10:15 
QuestionTab Control and GroupBox...Anybody? Pin
damir_tk12-Dec-06 9:29
damir_tk12-Dec-06 9:29 
AnswerRe: Tab Control and GroupBox...Anybody? Pin
led mike12-Dec-06 9:37
led mike12-Dec-06 9:37 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
damir_tk12-Dec-06 11:29
damir_tk12-Dec-06 11:29 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
led mike12-Dec-06 12:04
led mike12-Dec-06 12:04 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
Mark Salsbery12-Dec-06 11:32
Mark Salsbery12-Dec-06 11:32 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
led mike12-Dec-06 11:59
led mike12-Dec-06 11:59 
AnswerRe: Tab Control and GroupBox...Anybody? Pin
Mark Salsbery12-Dec-06 10:38
Mark Salsbery12-Dec-06 10:38 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
damir_tk12-Dec-06 11:31
damir_tk12-Dec-06 11:31 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
Mark Salsbery12-Dec-06 11:33
Mark Salsbery12-Dec-06 11:33 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
Sam Hobbs12-Dec-06 14:35
Sam Hobbs12-Dec-06 14:35 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
mirano12-Dec-06 22:56
mirano12-Dec-06 22:56 
AnswerRe: Tab Control and GroupBox...Anybody? Pin
Michael Dunn12-Dec-06 11:50
sitebuilderMichael Dunn12-Dec-06 11:50 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
Mark Salsbery12-Dec-06 12:07
Mark Salsbery12-Dec-06 12:07 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
Michael Dunn12-Dec-06 14:45
sitebuilderMichael Dunn12-Dec-06 14:45 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
mirano12-Dec-06 22:57
mirano12-Dec-06 22:57 
GeneralRe: Tab Control and GroupBox...Anybody? Pin
damir_tk12-Dec-06 12:20
damir_tk12-Dec-06 12:20 

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.