
Opening a file from C/C++ application
It is possible with ShellExecuteEx. Specify SEE_MASK_NOCLOSEPROCESS
flag, and you will get a handle to the new process. Use
WaitForSingleObject to wait on this handle.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Quote:
> It works. Thanks!
> Bu with ShellExecute, is it possible to ask the system to
> wait till the application is closed before executing the
> rest of the code?
> >-----Original Message-----
> >The ShellExecute or ShellExecuteEx functions should do
> what you want.
> >Documentation on the ShellExecute function can be found
> at the following
> >link
> >http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/shellcc/pla
> >tform/Shell/reference/functions/shellexecute.asp
> >If you call ShellExecute with the path to the .mdb file
> as its its
> >lpOperation parameter and "open" as its lpVerb parameter
> Windows will open
> >the file with it's associated application ie Access.
> >eg.
> >ShellExecute( NULL, "open", "C:\My
> Documents\MyDatabase.mdb", NULL, "C:\My
> >Documents", SW_SHOWNORMAL);
> >There is a link to the ShellExecuteEx function in the
> ShellExecute
> >documentation.
> >Hope this helps,
> >Daniel
> >> Hi
> >> I would like to know how I can open a Microsoft Access
> >> file from a C/C++ application.
> >> I used the function "spawnl" and managed to launch
> Access
> >> but cannot open a particular .mdb file.
> >> How can I do it? or any other ways to open the file?
> >> Thanks!
> >.