Logon Method
    (Connect Control)
   Windows - Visual C++
   Description
   The Logon method logs onto the 
   server without user interaction.
   Syntax
   long Logon();
   Return Value
   0 if the logon is successful, 
   otherwise an error code.
   Remarks
   Before you call Logon, you need to 
   set the Username,
    Password,
    and Server properties. 
   There are several ways to do this. You can set all of the 
   corresponding properties or you can set the UseSavedNames 
   property, which indicates that the Username, Password, and Server 
   should be obtained. You can use the AreNamesSaved 
   method to determine if the Username, Password, and Server have been 
   saved in the .ini file or Windows registry.
You may need to set the Section property prior to calling Logon. The default behavior is that the Section is obtained.
To display a Logon dialog box to the user, use the ShowLogon method.
Possible Errors:
| Error | Description | |
| DDICTL_E_R_NOSECTION | No Section set | |
| DDICTL_E_R_NOSERVER | No Server set | |
| DDICTL_E_R_NOPASSWORD | No Password set | |
| DDICTL_E_R_NOUSERNAME | No Username set. | |
See Also: UserName Password Server Section UseSavedNames AreNamesSaved ShowLogon
Back to: Connect Methods