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


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


    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.


  • GetCLSID Function


    void getCLSID(CLSID *clsid) const;


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


    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


    void getIID(IID *iid) const;


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


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

  • getLastRetrivedInterface Function


    void getLastRetrivedInterface(IUnknown **ppInterface) const;


    ppInterface [out] Points to an interface pointer


    Enters last retrived pointer to 'ppInterface'.

  • getLastSystemError


    HRESULT getLastSystemError() const;


    No parameters

    Return Value

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


Download source - 6 Kb



  • Obtain CLSID from IUnknown

    Posted by Legacy on 04/26/2002 12:00am

    Originally posted by: Navin Pai

    I have got the IUnknown pointer now is there any way from where I can get the CLSID of the component. Note there exists a proxy for that component and I dont want the CLSID of the proxy.

  • Please, Help me about dcom98.exe

    Posted by Legacy on 11/08/2001 12:00am

    Originally posted by: hwa min son

    I have some questions.
    Please, Help me.

    Question 1)
    How can I excute Dcom98.exe in the cab file that includes my program?
    My computer's OS is Window98.

    Question 2)
    When I tried to Setup my activex controls, I got error message.
    then I must setup dcom98.exe.
    I wish to include dcom98 in my program.
    but I don't know to way.

    How can my setup program include dcom98.exe or have some special dll list?


  • Please give an example...

    Posted by Legacy on 09/27/2001 12:00am

    Originally posted by: Zissopoulos John

    Please give an example...Use a standard COM object of Windows

  • SkDCOMbridge : COM/DCOM Handler Object

    Posted by Legacy on 07/08/2001 12:00am

    Originally posted by: mark

    what's up with the (2) CoInitialize(NULL); in your constructor???


    _ipCf = NULL;
    _pInterface = NULL;
    _lastSystemError = 0;
    _serverInfo.pwszName = NULL;


Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Lenovo recommends Windows 8 Pro. "I dropped my laptop getting out of the taxi." This probably sounds familiar to most IT professionals. If your employees are traveling, you know their devices are in for a rough go. Whether it's a trip to the conference room or a convention out of town, any time equipment leaves a user's desk it is at risk of being put into harm's way. Stay connected at all times, whether at the office or on the go, with agile, durable, and flexible devices like the Lenovo® …

  • Power and Automation Equipment makers face constrained CAPEX, equipment interoperability issues, and process inefficiencies. However, they can take advantage of secure Internet of Things (IoT) intelligent devices and systems to make better business decisions around asset utilization and performance, while simultaneously optimizing equipment interoperability and services efficiency. Watch this brief video to see how you can unlock the full potential of your assets and value chain.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date