Forum Discussion

krkarthik_info's avatar
krkarthik_info
Frequent Contributor
6 years ago

Unable to load C++ DLL

Hi All,

 

I have been trying to access routines from C++ DLL through TestComplete. But am getting the error as "Unable to load the dll library".

 

Using the below code to load the dll in TestComplete

function CallDLL()
{
var Def_DLL = DLL.DefineDLL("EXAMPLE");  

var Lib = DLL.Load("C:\\EXAMPLE.dll");
}

Could anyone suggest how to get this resolved.

 

Thanks in advance.

 

Thanks,

Karthik K R

  • Hi Alex,

     

    Thanks for the suggestions. Actually I have gone through those limitations. 

     

    My DLL were referring two more DLL's. So I tried to call those DLL's first using DLL.Load() before calling my actual DLL. 

    This way I was able to resolved the issue on loading the DLL.

     

    After this, my next question arise out of the situation is:

    Can we call the C++ routines which resides inside the class as

    ClassName.RoutineName(arguments)

    Thanks in advance.

     

    Thanks,

    Karthik K R

     

    • krkarthik_info's avatar
      krkarthik_info
      Frequent Contributor

      Hi Alex,

       

      Thanks for the suggestions. Actually I have gone through those limitations. 

       

      My DLL were referring two more DLL's. So I tried to call those DLL's first using DLL.Load() before calling my actual DLL. 

      This way I was able to resolved the issue on loading the DLL.

       

      After this, my next question arise out of the situation is:

      Can we call the C++ routines which resides inside the class as

      ClassName.RoutineName(arguments)

      Thanks in advance.

       

      Thanks,

      Karthik K R

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        > ClassName.RoutineName(arguments)

        I am pretty sure this is not possible because:

        a)  In order to do this, the class instance must be created first; and

        b) There is no way for TestComplete to get info as for how to call this or that method of some class. COM objects provide such information, but not regular classes.