Forum Discussion

nikki85's avatar
nikki85
Contributor
6 years ago

Call function of DLL at testcomplete

Hi Buddy ,

i failed to call function of DLL which is developed in C++

the function of DLL in C++ as below

#include "stdafx.h"
 int add(int a, int b)
{
  return a + b;

}

 

my script at testcomplete is as below

sub test
dim a
set Def_Dll=DLL.DefineDLL("test_dll")

Call Def_DLL.DefineProc("addA",vt_i4,vt_i4,vt_i4)
Call Def_DLL.DefineAlias("add", "addA")
                   
set Lib=Dll.Load("C:\Users\H208139\Desktop\test_dll\Debug\test_dll.dll","test_dll")

a=Lib.add(1,2)
log.Message(a)

end sub

 

test result :Object doesn't support this property or method: 'Lib.add'

12 Replies