- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone provide a quick sketch of how to set the structure for ShellExecute and run it?
Thanks in adv.
TimH
Thanks in adv.
TimH
Link Copied
11 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
poifect!
Is there a setting so that the execution halts in the caller until the spawned app is finished?
Thank,
Tim
Is there a setting so that the execution halts in the caller until the spawned app is finished?
Thank,
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to use ShellExecuteEx instead; type (T_)SHELLEXECUTEINFO contains hProcess member which you can WaitForSingleObject on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see I have to fix the HTML in that article so that the callout numbers are shown. I think I know what happened here...
I recommend reading back issues of the newsletter to all - many questions asked in this forum are answered in various articles.
Steve
I recommend reading back issues of the newsletter to all - many questions asked in this forum are answered in various articles.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Jugoslav,
I had originally looked at the Ex version and the were so many settings I thought I'd be experimenting for ever. I'll give it another try.
Steve,
I used to get notices whenever these newletters came out but no more. How can I sign up for them?
Tim
I had originally looked at the Ex version and the were so many settings I thought I'd be experimenting for ever. I'll give it another try.
Steve,
I used to get notices whenever these newletters came out but no more. How can I sign up for them?
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And one other thing:
I declared lpParam as a character(80) so that it can be assign under different conditions. But the line
lpParam=NULL_CHARCATER
produced an " access violation".
setting it char(0) seems to go ok.
any ideas?
Tim
I declared lpParam as a character(80) so that it can be assign under different conditions. But the line
lpParam=NULL_CHARCATER
produced an " access violation".
setting it char(0) seems to go ok.
any ideas?
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim,
We haven't issued a newsletter in a long time, but hope to get a new one out soon. If you got the notice about Intel Fortran 7, you're on the list.
Steve
We haven't issued a newsletter in a long time, but hope to get a new one out soon. If you got the notice about Intel Fortran 7, you're on the list.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re lpParameters: My reading of the docs is that
- if lpFile is an .exe file, lpParameters mustn't be NULL
- if lpFile is a document, lpParameters should be NULL.
Jugoslav
- if lpFile is an .exe file, lpParameters mustn't be NULL
- if lpFile is a document, lpParameters should be NULL.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reason I used ShellExec. was that I wanted to open and MDB file(ms-access),
otherwise RunQQ would do fine for an .EXE.
So lpFile is a document, yet NULL gives the axs viol. this contardicts your guess, jugoslav, right?
Anyway, is there a difference between NULL_CHARACTER and char(0)??
Tim
otherwise RunQQ would do fine for an .EXE.
So lpFile is a document, yet NULL gives the axs viol. this contardicts your guess, jugoslav, right?
Anyway, is there a difference between NULL_CHARACTER and char(0)??
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NULL_CHARACTER passes the address zero. CHAR(0) passes the address of a zero-length string (in C terms). The lpFile parameter is not documented as permitting a NULL address, so pass CHAR(0) if you want to omit it.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, my interp of lpParameters was correct; however, I didn't look carefully at Tim's code. He was trying to
CHARACTER(80) lpParam
...
lpParam = NULL_CHARACTER !Access violation
you mustn't copy from address of 0 anywhere.
- NULL_CHARACTER is of type character and has address 0
- char(0) is of type character and has a valid address, containing binary zero.
- NULL is the same as 0 in Fortran
Note that SHELLEXECUTEINFO%lpParameters is declared as an INTEGER(LPCTSTR); however, in INTERFACE to ShellExecute, lpParameters is declared as CHARACTER(*). Thus, in the former, assign NULL (or 0) to that SEI%lpParameters. In the latter, use NULL_CHARACTER:
SEI%cbSize = SIZEOF(SEI)
SEI%fMask = SEE_MASK_NOCLOSEPROCESS
SEI%hwnd = NULL
SEI%lpVerb = LOC("open"C)
SEI%lpFile = "C:mydatamybase.mdb"C
SEI%lpParameters = NULL
SEI%lpDirectory = NULL
SEI%nShow = SW_SHOWDEFAULT
!Other members are either Output or unused, depending on fMask.
Jugoslav
CHARACTER(80) lpParam
...
lpParam = NULL_CHARACTER !Access violation
you mustn't copy from address of 0 anywhere.
- NULL_CHARACTER is of type character and has address 0
- char(0) is of type character and has a valid address, containing binary zero.
- NULL is the same as 0 in Fortran
Note that SHELLEXECUTEINFO%lpParameters is declared as an INTEGER(LPCTSTR); however, in INTERFACE to ShellExecute, lpParameters is declared as CHARACTER(*). Thus, in the former, assign NULL (or 0) to that SEI%lpParameters. In the latter, use NULL_CHARACTER:
SEI%cbSize = SIZEOF(SEI)
SEI%fMask = SEE_MASK_NOCLOSEPROCESS
SEI%hwnd = NULL
SEI%lpVerb = LOC("open"C)
SEI%lpFile = "C:mydatamybase.mdb"C
SEI%lpParameters = NULL
SEI%lpDirectory = NULL
SEI%nShow = SW_SHOWDEFAULT
!Other members are either Output or unused, depending on fMask.
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page