Click to See Complete Forum and Search --> : GetOpenFileName/CFileDialog problem
yzkzero
September 14th, 2006, 04:59 AM
I use OFN_ALLOWMULTISELECT flag to let file dialog be able to select multi files and meet an problem:
If I choose more than one file and one of them cannot be access ( already used by other process ), the file open dialog will warning me "This file is already in use". But if I only choose one file, that's OK even if the file is also inaccessible.
So how can I do to make dialog not show this warning? I only want to get file name but to access them.
yzkzero
September 18th, 2006, 10:22 PM
nobody knows?
golanshahar
September 19th, 2006, 03:33 AM
Well are you sure you dont try to open a file that is really being used by other process?
You can look at this thread (http://www.codeguru.com/forum/showthread.php?t=396599&p=1440849) for sample of using OFN_ALLOWMULTISELECT
Cheers
yzkzero
September 20th, 2006, 10:00 PM
Yes, I am exact sure.
Actually, my program need to get a lot of files being used by another process. But it only do get file names and insert into my database but to access them.
Now, file open dialog dont let me to do this. I have to choose them one by one. So who can help me?
Thanks a lot !
golanshahar
September 21st, 2006, 05:03 PM
Yes, I am exact sure.
Actually, my program need to get a lot of files being used by another process. But it only do get file names and insert into my database but to access them.
Now, file open dialog dont let me to do this. I have to choose them one by one. So who can help me?
Thanks a lot !
I tested that issue with the demo project I posted in my previous link.
Here is what I did:
I opened doc file with word, open also bmp file and text file now when those file are opened in their applications I ran my demo project and selected those files I was able to get all the file names and I didn’t get any message that you said you are getting. :confused:
What kind of opened files you are trying to access?
Cheers
yzkzero
September 22nd, 2006, 09:32 AM
hi, golanshahar
You can try the file pagefile.sys. Even you open the doc with word, the doc file is also accessable by other process. The files I described is those are occupied by other process and cannot be read.
Thank you!
yzkzero
October 5th, 2006, 04:45 AM
up
golanshahar
October 5th, 2006, 04:47 PM
hi, golanshahar
You can try the file pagefile.sys. Even you open the doc with word, the doc file is also accessable by other process. The files I described is those are occupied by other process and cannot be read.
Thank you!
I tested it with pagefile.sys as you mentioned and you are right when you pick this file with others there is access deny message box and when you only pick that file alone it is working without any message.
At the moment I have no clue why...sorry :(
Cheers
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.