dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: Dcom Interface No such interface supported after migration to X64

  1. #1
    Join Date
    Feb 2017
    Location
    Switzerland, Wallisellen
    Posts
    10

    Dcom Interface No such interface supported after migration to X64

    After the migration to 64 Bit we can not create some CComPtr< anymore.

    Not all off the DCom Objects have the same error. I cant see the why on is working and the other is not working


    here some Information on the working one

    The IDL File

    Code:
    // NmsTaskDbSv.idl
    
    import "oaidl.idl";
    import "ocidl.idl";
    
    [
      object,
      uuid(9B870525-DB58-11D1-B532-00A024D2B68A),
      dual,
      helpstring("INmsDbData Interface"),
      pointer_default(unique)
    ]
    
    interface INmsDbData : IDispatch
    {
      [id(1)] HRESULT Do       ( [in] long id, [in] BSTR version, [in] BSTR sender, [in] BSTR login, [in] BSTR selection, [out, retval] long* retval);
      [id(2)] HRESULT Request  ( [in] long id, [in] BSTR version, [in] BSTR sender, [in] BSTR login, [in] BSTR selection, [in, out] BSTR* data, [out, retval] long* retval );
      [id(3)] HRESULT OnTicket ( [in] BSTR dialNumber, [in] BSTR recordType, [in] BSTR calculatedCharge, [in] BSTR currency, [in] BSTR chargePulseInfo, [in] BSTR timeStamp, [in] BSTR duration, [in] BSTR digits, [out, retval] long* retval );
      [id(4)] HRESULT sendCmd  ( [in] BSTR cmd, [in, out] BSTR* result );
      [id(5)] HRESULT sendCmdBinary ( [in] BSTR clientName, [in] BSTR userName, [in] BSTR cmd, [in, out] BSTR* result );
    };
    
    [
      uuid(A2B28E54-D524-11D1-B51B-00A024D2B68A),
      version(1.0),
      helpstring("NmsTaskDbSv 1.0 Type Library")
    ]
    
    library NmsTaskDbSvLib
    {
      importlib("stdole32.tlb");
      importlib("stdole2.tlb");
      [
        uuid(A2B28E53-D524-11D1-B51B-00A024D2B68A),
        helpstring("NmsTaskDbSv.NmsDbData")
      ]
      coclass NmsDbData
      {
        [default] interface INmsDbData;
      };
    };
    and the RGS File

    Code:
    HKCR
    {
    	NmsTaskDbSv.NmsDbData = s 'NmsTaskDbSv.NmsDbData'
    	{
    		CLSID = s '{A2B28E53-D524-11D1-B51B-00A024D2B68A}'
    	}
    	NoRemove CLSID
    	{
    		ForceRemove {A2B28E53-D524-11D1-B51B-00A024D2B68A} = s 'NmsTaskDbSv.NmsDbData'
    		{
    			ProgID = s 'NmsTaskDbSv.NmsDbData'
    			VersionIndependentProgID = s 'NmsTaskDbSv.NmsDbData'
    			ForceRemove 'Programmable'
    			LocalServer32 = s '%MODULE%'
    			val AppID = s '{D2FF4B01-F303-11D2-8352-00A02479FB54}'
    		}
    	}
    }
    the same Info about the not working one

    IDL

    Code:
    // NmsTaskManager.idl
    
    import "ITask.idl";
    
    [
      uuid(2DF6EF8A-3EE8-11D1-BF07-008029E20A31),
      helpstring("IJobManager Interface"),
      pointer_default(unique)
    ]
    
    interface IJobManager : IUnknown {
      //HRESULT sendCmd ( [in] BSTR cmd, [out] BSTR* result );
      HRESULT sendCmdBinary ( [in] BSTR clientName, [in] BSTR userName, [in] BSTR cmd, [in, out] BSTR* result );
    };
    
    // Class library
    [
      uuid(2DF6EF80-3EE8-11D1-BF07-008029E20A31),
      version(1.0),
      helpstring("NmsTaskManager 1.0 Type Library")
    ]
    library NmsTaskManagerLib
    {
      importlib("stdole32.tlb");
      importlib("stdole2.tlb");
      [
        uuid(2DF6EF8B-3EE8-11D1-BF07-008029E20A31),
        helpstring("NmsTaskManager.JobManager")
      ]
      coclass JobManager
      {
        [default] interface IJobManager;
      };
    };

    and the rGS

    Code:
    HKCR
    {
    	NmsTaskManager.JobManager = s 'NmsTaskManager.JobManager'
    	{
    		CLSID = s '{2DF6EF8B-3EE8-11D1-BF07-008029E20A31}'
    	}
    	NoRemove CLSID
    	{
    		ForceRemove {2DF6EF8B-3EE8-11D1-BF07-008029E20A31} = s 'NmsTaskManager.JobManager'
    		{
    			ProgID = s 'NmsTaskManager.JobManager'
    			VersionIndependentProgID = s 'NmsTaskManager.JobManager'
    			ForceRemove 'Programmable'
    			LocalServer32 = s '%MODULE%'
    			val AppID = s '{2DF6EF81-3EE8-11D1-BF07-008029E20A31}'
    		}
    	}
    }
    The Code for creating the dcomInterfac is the following

    Code:
    static void doSetDcomClientInterface( const CString& serverName, const CString& aName, const CString& cName, const CString& clsid, const CString& appid ){
      out("... doSetDcomClientInterface serverName:" + serverName + " aName:" + aName +  " cName:" + cName + " clsid:"  + clsid  + "  appid:" + appid + "   ... ");
      doDeleteKey( "HKCR\\CLSID\"+clsid );
      doDeleteKey( "HKCR\\AppID\"+appid );
      doSetKey( "HKCR\"+cName        , ""                 , cName       );
      doSetKey( "HKCR\"+cName+"\\CLSID" , ""              , clsid       );
      doSetKey( "HKCR\\AppID\"+appid , ""                 , aName       );
      doSetKey( "HKCR\\AppID\"+appid , "RemoteServerName" , serverName  );
      doSetKey( "HKCR\\CLSID\"+clsid , ""                 , cName       );
      doSetKey( "HKCR\\CLSID\"+clsid , "AppID"            , appid       );
      out("... doSetDcomClientInterface serverName:" + serverName + " aName:" + aName + " cName:" + cName + " clsid:" + clsid + "  appid:" + appid + "  done ... ");
    }
    So he just creates the necessary Registry entries ( doSetKey) writes to the windows registry. Where can the problem with the dcom Interface
    Last edited by 2kaud; January 18th, 2019 at 07:58 AM. Reason: Added code tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)