In another executable you cannot use the same handle, because they don't share the same memory space...
Any "handle" of any type is always specific to and valid only in the process in which it was obtained or for which it was duplicated.
Not quite on topic but.....
You know a long time ago I wrote an MS-DOS demo to test/review file status in the shared/locked file environment. You could do things like select what file to open in what mode with what locking and sharing , then lock / free individual records and try writing, reading, etc and query the status codes and data.
I wonder if maybe something like this for Windows - using two separate processes - might not be a handy thing? It could allow 'network testing' without having two computers.
(Since MS-DOS was single-tasking only, the only way the old tool was really useful was to run two separate copies of the program on two seprate computers and have each computer open the same network file).
Maybe this is another possibility for one of Mr. Purvis' contests? Surely it could be useful to "newbies to multiuser programming."
MCM
Leave a comment: