SkDCOMbridge : COM/DCOM Handler Object | CodeGuru

SkDCOMbridge : COM/DCOM Handler Object

The code here is also a great example of how to use Windows API for handling COM/DCOM objects. Method Descriptions and Definitions Main function : getInterfacePointer Prototype int getInterfacePointer(IUnknown **ppInterface, void *comObjectInfo, void *interfaceObjectInfo, int flags = SKDCOM_COMINFO_NAME | SKDCOM_INTERFACEINFO_NAME, void *computerName = NULL, COAUTHINFO *pAuthInfo = NULL); Parameters ppInterface [out] Pointer for interface pointer […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 5, 2000
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

The code here is also a great example of how to use Windows API for handling COM/DCOM objects.

Method Descriptions and Definitions

  • Main function : getInterfacePointer

    Prototype

    int getInterfacePointer(IUnknown **ppInterface,
                            void *comObjectInfo,
                            void *interfaceObjectInfo,
                            int flags = SKDCOM_COMINFO_NAME
                                      | SKDCOM_INTERFACEINFO_NAME,
                            void *computerName = NULL,
                            COAUTHINFO *pAuthInfo = NULL);
    

    Parameters

    ppInterface [out] Pointer for interface pointer in which the method should enter the desired interface’s pointer.
    comObjectInfo [in] COM object’s description. can be name [OLE string !] or CLSID.
    interfaceObjectInfo [in] Interface’s description. can be name [OLE string] or IID.
    flags [in] flags which describes ‘comObjectInfo’ and ‘interfaceObjectInfo’

    use SKDCOM_COMINFO_NAME – when ‘comObjectInfo’ is object’s a name (such as ‘MyCOM.Engine’)

    SKDCOM_COMINFO_CLASID – when ‘comObjectInfo’ is object’s an CLSID.

    SKDCOM_INTERFACEINFO_NAME – when ‘interfaceObjectInfo’ is a name (such as ‘MyCOM.Engine.iXYZ’)

    SKDCOM_INTERFACEINFO_REFIID – when ‘interfaceObjectInfo’ is an IID

    each flag value should be a logical or of ‘comObjectInfo’ and ‘interfaceObjectInfo’ descriptions.

    default value is name for both.

    computerName [in] points to a computer name. DCOM ONLY. if NULL object uses COM.
    pAuthInfo [in] points to a ‘COAUTHINFO’ object. DCOM ONLY. if NULL object uses default security parameters.

    Remarks

  • GetCLSID Function

    Prototype

    void getCLSID(CLSID *clsid) const;
    

    Parameters

    clsid [out] Pointer to a CLSID instance which will recieve object’s CLSID value.

    Remarks

    Retrieves object’s CLSID (even if main method was called with name for object’s description)

    Return Value

    • SKDCOM_ERROR_CLSID_NAME_NOT_FOUND – object’s name was not found.
    • SKDCOM_ERROR_CLSID_NOT_FOUND – object’s ID was not found.
    • SKDCOM_ERROR_IID_NOT_FOUND – interface’s ID was not found.
    • SKDCOM_ERROR_IID_NAME_NOT_FOUND – interface’s name was not found.
    • SKDCOM_ERROR_FAIL – function failed.
    • SKDCOM_SUCCESS – success. output parameter is valid.
  • getIID Function

    Prototype

    void getIID(IID *iid) const;
    

    Parameters

    iid [out] Pointer to an IID instance which recieve interface’s IID value.

    Remarks

    Retrieves interface’s IID (even if main method was called with name for interface description)

  • getLastRetrivedInterface Function

    Prototype

    void getLastRetrivedInterface(IUnknown **ppInterface) const;
    

    Parameters

    ppInterface [out] Points to an interface pointer

    Remarks

    Enters last retrived pointer to ‘ppInterface’.

  • getLastSystemError

    Prototype

    HRESULT getLastSystemError() const;
    

    Parameters

    No parameters

    Return Value

    Returns system last error (Window’s API error code).

Downloads

Download source – 6 Kb

History

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.