Forum Discussion

subbuV's avatar
subbuV
New Contributor
7 years ago

Calling DLL Objects from TestComplete

I am currently trying to call an object from a DLL but not sure how best to do it in TestComplete. There is a DLL that our development team has produced (CompassAPI.dll) which is a COM object. I woul...
  • AlexKaras's avatar
    7 years ago

    Hi,

     

    > (CompassAPI.dll) which is a COM object.

    This means that this dll cannot be used via the DLL access in TestComplete because DLL functionality makes it possible to access regular functions exported by DLLs. (Read TestComplete documantation and talk to developers for more info on DLL exported functions.)

    As this is a COM object, you must work with it as with any other COM dll:

    -- COM object(s) provided by this dll must be registered in the system. Usually this is done via the 'regsvr32 <file.dll>' command, but if this dll is .Net-based, some other steps might be required. Talk to your developers and ask them how to do the registration in your system;

    -- After COM objects are registered, you can create their instances in your test code via the Sys.OleObject() method. E.g. Sys.OleObject('Excel.Application') will instantiate an instance of Excel COM object. You must know COM object identifier (ProgID) (Excel.Application in the previous example) to create an object instance. Ask your developers or your documentation if you don't know it.