I have a VB6 project that was generated with the C3PO project wizard back in 2006. It works as intended for GroupWise 8. However, it throws an error on GroupWise 2014 SP2 when my custom toolbar button is clicked. I narrowed it down to the ClientState.SelectedFolder property being accessed. The error is as follows:

Error Executing GWCommand: 2

Err Number: -2147024882
Description: Could not proxy for user.

Here is what the VB6 code in question looks like:
Public Sub Execute()
    Dim clst As Object
    On Error GoTo Execute_Err
    Set clst = g_C3POManager.ClientState

    Select Case m_sPersistentID
        If clst.SelectedFolder.ObjType = egwContacts Then  'Error is thrown here
What needs to be changed to make this work on GroupWise 2014? I have already experimented with the IGWClientState and IGWFolder types, but no success came of it.

Thanks in advance,