You are viewing limited content. For full access, please sign in.

Question

Question

Unable to cast COM object of type 'System.__ComObject' to interface type 'LFSO102Lib.LFDatabase'.

asked on May 30, 2019

hello All,

when i am debugging the following code i am facing following Error.

Dim client As LFClient.Document

            client = GetObject(Nothing, "LFClient.Document")

            Dim ActiveRepository As LFDatabase

            ActiveRepository = client.GetDatabase()

 

Error:

Unable to cast COM object of type 'System.__ComObject' to interface type 'LFSO102Lib.LFDatabase'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EC6C659C-E0B1-48E1-AC0A-5097B1B78300}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

 

any idea what is wrong in my code?

0 0

Replies

replied on May 30, 2019

You created the objects, but need to make a connection to the repository. Roughly, you'll need something like this:

            Dim repository As New RepositoryRegistration(LF_ServerName, LF_RepoName)
            Dim LF_Session As New Session()

            'Select a log in method
            If LF_UserName.Trim.Length > 0 Then
                'Use a Repository Account
                LF_Session.LogIn(LF_UserName, LF_Pwd, repository)
            Else
                'Use Windows Authentication
                LF_Session.LogIn(repository)
            End If

 

 

0 0
replied on June 3, 2019

Make sure you are referencing the same version of LFSO as the LF client. E.g. if you are using the 10.3 client, your project needs to reference LFSO 10.3.

 

Depending on what your integration does, you might want to switch to use Client Automation Tools (CAT) to control the Laserfiche desktop client. See this Empower course for more information and sample code.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.