Click here to Skip to main content
15,891,567 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
David Crow20-Sep-04 5:43
David Crow20-Sep-04 5:43 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
Neeranjan20-Sep-04 20:22
Neeranjan20-Sep-04 20:22 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
David Crow21-Sep-04 3:40
David Crow21-Sep-04 3:40 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
Neeranjan21-Sep-04 4:38
Neeranjan21-Sep-04 4:38 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
David Crow21-Sep-04 5:24
David Crow21-Sep-04 5:24 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
Neeranjan21-Sep-04 20:37
Neeranjan21-Sep-04 20:37 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
David Crow22-Sep-04 5:02
David Crow22-Sep-04 5:02 
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
Neeranjan22-Sep-04 18:40
Neeranjan22-Sep-04 18:40 
If you know the concept of workspace file then it will be easy to understand my explanation as below.
1. When I open a database file from my application, it loads the database file data in to application variables.
2. I perform some operation on the data, stored in application variables.
3. Now here I have two options:
   a) I save the application variable data back to the database file.
   b) I save the application variable data into a workspace file i.e. an archive file.
Workspace file: Is the copy of memory variables and data stored in variables on to the disk file.
4. Next time when I start the application I will have two options to load the data:
   a) Open the database file and load the data in applicaiton variables.
   b) Open the workspace file and load the data in applicaiton variables.


Suppose I have started the first instance of application and opened a workspace file(X) i.e. loaded data from workspace file into application variables. ( Here I have to close the file after loading the data, bcoz I will modify data and save data several times and some more things....)
Now I start the second instance of application and load the same workspace file (X).Here I will perform some operation and when I save it then it to workspace it will overwrite the file X even though first instance has modified the data and save back to workspace file X. Thus, here I loose the data saved by the first instance.

I think now you have been understood, why I need to lock a file which is already closed?
Now tell me, is there any solution for this problem?



Thanks & Regards,
Neeraj
GeneralRe: How to lock a CFile in VC++ 6.0? Pin
David Crow23-Sep-04 2:50
David Crow23-Sep-04 2:50 
GeneralCalling C# web service from c++/MFC Pin
fajlerköaölgja19-Sep-04 22:09
fajlerköaölgja19-Sep-04 22:09 
Generalstupid question Pin
eli1502197919-Sep-04 21:49
eli1502197919-Sep-04 21:49 
GeneralRe: stupid question Pin
fajlerköaölgja19-Sep-04 22:33
fajlerköaölgja19-Sep-04 22:33 
GeneralRe: stupid question Pin
eli1502197919-Sep-04 23:10
eli1502197919-Sep-04 23:10 
GeneralApplying Windows XP Visual Style Pin
aninddroy19-Sep-04 21:18
aninddroy19-Sep-04 21:18 
GeneralAdding IPv6 address programatically Pin
Alpha Siera19-Sep-04 19:13
Alpha Siera19-Sep-04 19:13 
GeneralTEMPLATE FUNCTIONS Pin
ISUstudent19-Sep-04 18:56
ISUstudent19-Sep-04 18:56 
GeneralRe: TEMPLATE FUNCTIONS Pin
Antti Keskinen19-Sep-04 23:08
Antti Keskinen19-Sep-04 23:08 
GeneralPragma Pin
caoquanghanh19-Sep-04 18:43
caoquanghanh19-Sep-04 18:43 
GeneralRe: Pragma Pin
Ramkrishna Pawar19-Sep-04 20:19
Ramkrishna Pawar19-Sep-04 20:19 
GeneralRe: Pragma Pin
caoquanghanh22-Sep-04 19:47
caoquanghanh22-Sep-04 19:47 
GeneralRe: Pragma Pin
Alpha Siera20-Sep-04 3:06
Alpha Siera20-Sep-04 3:06 
Generalcircular linked lists Pin
jhorstkamp19-Sep-04 17:42
jhorstkamp19-Sep-04 17:42 
GeneralRe: circular linked lists Pin
Antti Keskinen19-Sep-04 23:28
Antti Keskinen19-Sep-04 23:28 
GeneralString stuff Pin
Timothy Grabrian19-Sep-04 17:02
professionalTimothy Grabrian19-Sep-04 17:02 
GeneralRe: String stuff Pin
Aamir Butt20-Sep-04 0:06
Aamir Butt20-Sep-04 0:06 

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.