ArcFM Solution Developer Guide
Login Method (IMMLoginObject)


Version: 10.2.1a

Resource Center Home

Returns a boolean value indicating whether the user has previously logged into the database. The parameter is True when ArcMap is initially opened. Once the user clicks the Login button on the ArcFM Solution toolbar, the parameter value changes to False. This indicates that the user has logged into another database.

This routine is used to login to the system database. Custom login objects can bring up a customized login dialog here, collect connection information, and perform other tasks. The vbInitialLogin parameter is True at the startup of ArcMap. It has a value of False when the login command is called from the ArcFM Solution toolbar. The login method itself should return a value indicating whether or not the user has logged into a different database.
Syntax
'Declaration
 
Function Login( _
   ByVal vbInitialLogin As Boolean _
) As Boolean
'Usage
 
Dim instance As IMMLoginObject
Dim vbInitialLogin As Boolean
Dim value As Boolean
 
value = instance.Login(vbInitialLogin)
bool Login( 
   bool vbInitialLogin
)

Parameters

vbInitialLogin

Returns a boolean value indicating whether the user has previously logged into the database. The parameter is True when ArcMap is initially opened. Once the user clicks the Login button on the ArcFM Solution toolbar, the parameter value changes to False. This indicates that the user has logged into another database.

Return Value

Returns a boolean value indicating whether or not the user has logged into a different database.

Remarks

The login method must provide a fairly comprehensive implementation. There are a number of things to consider:

Example
The following code sample demonstrates how the IMMLoginObject::Login method may be implemented.
Visual Basic Copy Code
Private Function IMMLoginObject_Login(ByVal vbInitialLogin As Boolean) As Boolean

    Dim pArcFMDefaultLogin As IMMDefaultLoginObject
    Set pArcFMDefaultLogin = m_pDefaultLogin 'QI

    'You can use vbInitialLogin to check if this is
    'the first login
    If vbInitialLogin Then
        Dim sDBPath As String
        sDBPath = "D:\Databases\System.mdb"

        With m_pPropertySet
            .SetProperty "DATABASE", sDBPath
            .SetProperty "USERNAME", "testUser"
        End With

        'we do not want to see the default login dialog
        pArcFMDefaultLogin.ShowDialog = False

        'set the connection properties for the default login object
        pArcFMDefaultLogin.SetConnectionProperties m_pPropertySet

        'Call the login method on the default login object
    Else
        'User has clicked the login button from the ArcFM Toolbar
        pArcFMDefaultLogin.ShowDialog = True
    End If
        m_pDefaultLogin.Login vbInitialLogin
End Function
Requirements

Target Platforms: Windows XP SP3 (32-bit and 64-bit), Windows 7 (32-bit and 64-bit)

Not all Operating Systems are supported on all products. Visit the ArcFM Solution Supported Versions page for full details.

See Also

Reference

IMMLoginObject Interface
IMMLoginObject Members

 

 


Send Comment