Ask a Question

Call function of DLL at testcomplete

nikki85
Contributor

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 12

 I attached the modified dll

TanyaYatskovska
SmartBear Alumni (Retired)

Community, are there more ideas?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



>  I attached the modified dll

Hm-m-m... I don't see attached dll (and sources)...

Can you double check please?

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: