Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXE1 -> DLL -> EXE2???

Status
Not open for further replies.

clear88

Programmer
Nov 29, 2001
24
CN
Hi there,

I am not very good in English. I hope you know what I mean. THANKS :)

Is there a way to launch an exe file via calling DLL file? (requires waiting for the EXE2 exit)

<< OR there is an DLL has already built in the Windows 2000? So, I can call use iy directly? >>


Possibly, you are asking why I can't call the EXE2 directly ( EXE1 -> EXE2 )

The problem is I want....

1. EXE1 launch EXE2
2. Waiting for the EXE2 exit
3 Continue running EXE1

BUT, the EXE1 doesn't have any WAIT switches. However, the doc said EXE1 supports DLL call and only DLLs run synchronously( can't rebuild the EXE1 file )

Any suggestions?

Cheers

 
from the DOC....

________________________________________________

What types of programs can be used as connect actions?
A connect action can be:
A dynamic-link library (DLL). Only DLLs run synchronously, meaning that Connection Manager starts the action and then waits for the function to return before continuing. The first argument, specified as the Parameters in the Add/Edit Connect Actions dialog box of the CMAK wizard, is the function name within the DLL to call. The syntax for each of these connect actions is:
HRESULT WINAPI function
[IN] HWND hWndParent
[IN] HINSTANCE hinstDll
[IN] LPCSTR pszCommandLine
[IN] DWORD dwReserved
Supported DLL parameters are: Parameter Result
hWndParent Handle to the Connection Manager logon dialog box or NULL; used as the parent window for any user interface displayed by the connect action.
hinstDll Handle to the instance of this DLL.
pszCommandLine String pointer to the command-line arguments.
dwReserved Reserved for future use.

DLLs often have a comment (entered in the description field of the CMAK wizard) that appears while it is being run. This comment has the form Running Connect Action Description. The Connection Manager window is frozen and does not accept input while this action runs.
The connect action requires a return value. If the return value is less than 0, the DLL call failed (SUCCEEDED macro returns False). In the case of a failure, an error message (including the return value) is displayed in the form &quot;Connect Action Description failed return value.&quot; If a pre-connect, pre-tunnel, or post-connect action fails, the connection attempt is ended.
The DLL is unloaded after the function call.
Note
For .dll files that require extended times for the program to run, you should implement WM_PAINT in the .dll to ensure that graphics are not disrupted by user actions.
An executable file such as a .bat, .exe, or .cmd file. This type of connect action is run asynchronously, which means that Connection Manager starts the executable, including any command-line parameters, and continues without waiting for the process to exit. No comment appears in the Connection Manager status pane for one of these programs while it is being run.
A shell-executable file, such as a .txt or .doc file. These actions run asynchronously. These files need an appropriate program with which to open the file.
Note
To cause the connection to end after specified programs have ended, set these programs up as auto-applications, not as connect actions. For example, if you want to automatically run an e-mail program, and then automatically end the connection when the user quits the e-mail program, you must set up e-mail as an auto-application, not as a connect action.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top