Harvest

 View Only

Unable to cast COM object of type 'CHSDKLib.CaWHarvestClass' to interface type 'CHSDKLib.ICaWHarvest'.

  • 1.  Unable to cast COM object of type 'CHSDKLib.CaWHarvestClass' to interface type 'CHSDKLib.ICaWHarvest'.

    Posted Oct 21, 2020 12:23 PM
    Hi,

    I use Windows 10 64 bit version.
    I register regsvr32  chsdk.dll - from 32 bit Havestr 13 installation.

    In my program (. net Core of .NET Framework):

    CaWHarvest harvest = new CaWHarvest();

    var res = harvest.Login("brocker", "user", "pass");

    I get error:

    System.InvalidCastException
    HResult=0x80004002
    Message=Unable to cast COM object of type 'CHSDKLib.CaWHarvestClass' to interface type 'CHSDKLib.ICaWHarvest'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{70107C61-8ABB-11D5-961B-0010A4F73DE4}' failed due to the following error: Zły typ zmiennej. (0x80020008 (DISP_E_BADVARTYPE)).
    Source=System.Private.CoreLib
    StackTrace:
    at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
    at CHSDKLib.CaWHarvestClass.Login(String bstrBrokerName, String bstrUserName, String bstrPassword)

    Please help.