Opening multiple files using ShellExecute 
Author Message
 Opening multiple files using ShellExecute

Quote:

> Hello,

> I am opening multiple files using ShellExecute. The files can be images or wav

files, etc sent to their respective editing
Quote:
> application. However, passing the full path name of the files for the

ShellExecute parameter, could be too long. Let's say if the
Quote:
> files are located in a deep hierarchy folder level, and you want to open, say

50 files (doesn't matter why when where and how, let's
Quote:
> just assume it's 50) So I concatenate all these names into a CString and pass

it along to ShellExecute. So far it is working, but
Quote:
> what is the limit for the concatenated string length? Is it MAX_PATH?

> So here is the question. I had a better idea. I use a while loop instead, and

call ShellExecute for every document file I want to
Quote:
> open. This way I only have to pass 1 file name/path at a time. So I just would

like to make sure if this is a correct way to use
Quote:
> ShellExecute to open multiple document files at once, so that I call

ShellExecute in a loop for each doc file........ ?

Quote:

> Thanks,

> Laci

I am not the MS guy, but ShellExecute works exactly this way - it opens
something then returns. So in my opinion, the loop would be a lot better
solution than passing 32kB string for example! Do your loop :-)
Regards,
Peter


Tue, 15 Feb 2005 12:09:27 GMT  
 Opening multiple files using ShellExecute

Quote:

> I had a better idea. I use a while loop instead, and call
> ShellExecute for every document file I want to open. This
> way I only have to pass 1 file name/path at a time. So I
> just would like to make sure if this is a correct way to use

I think it would be a lot easier to debug if you had one bad path as
well :-)

I'd stick with this method.

--
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Tue, 15 Feb 2005 20:11:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to open files in the existing app with ShellExecute()

2. Selecting multiple files in Win File->Open dialog

3. Q: File Open Dialogbox allow multiple file selection

4. opening a file using open method

5. Problem with opening binary files using open()

6. problems using one header file for multiple source files

7. Trouble Getting multiple files using Common File Dialog

8. How to assimilate a dbase file using file opens() and reads()

9. Using Open file dialog to find file

10. Opening Multiple Files

11. opening multiple files in c

12. Opening multiple files in C

 

 
Powered by phpBB® Forum Software