AsyncLogon Property (Connect Control)
Windows - Visual C++


Description
The AsyncLogon property, when set to TRUE, causes the Logon and ShowLogon methods to return immediately, while the logon process continues in the background.

Syntax
long value = GetAsyncLogon();
void SetAsyncLogon(long value);

Value
1 if Logon and ShowLogon should operate asynchronously; 0 (the default) if synchronously.

Remarks
Asynchronous Logon is trickier to program than Synchronous Logon but it is the only way to write a professional-quality application. When you call ShowLogon with AsyncLogon FALSE (the default), the application will not respond to user input until the server has responded to the logon request. If the server is not running it will take a full minute to determine this, during which time the user can't move or close the application window.

If you call ShowLogon with AsyncLogon TRUE, the user will be able to move the window on screen, or give up and close the application, while waiting for the response from the server. ShowLogon will return immediately after closing the Logon dialog box and sending the logon request to the server.

If an error is detected locally (for instance no password), ShowLogon will return with an error code and the logon request will not be sent to the server. Otherwise ShowLogon will return 0 and you must wait for the LogonResult event. If there was an error (for instance wrong password), the parameter to the LogonResult event will be an error code. Otherwise it will be 0 and you must wait for the ConnectionDone event before opening headline views or making other demands on the server.

Do not call Disconnect before receiving the LogonResult event. Doing so will get unpredictable results. You may unload OcxConn and terminate the program at this time.

Both Logon and ShowLogon are affected by AsyncLogon. All remarks about ShowLogon apply to Logon too, except that Logon does not show a Logon dialog box.

See Also: LogonResult ShowLogon Logon

Back to: Connect Properties