neha_sharma
12 years agoContributor
Calling DLL from testcomplete
Hi,
i am using TestComplete 10 and need to call DLL routine from my script unit.
DLL function is :
TestComplete code is :
Object doesn't support this property or method: 'Lib1.AddMyValuesOne'
Error location:
Unit: "GmailKeywordTest\GmailKeywordTest\Script\Unit1"
Line: 12 Column: 5.
I dont know what is wrong with the code.Followed all steps mentioned in TestComplete help.
Any suggestions.
Thanks,
Neha
i am using TestComplete 10 and need to call DLL routine from my script unit.
DLL function is :
Public Class MyFunctions
Public Function AddMyValues(ByVal Value1 As Integer, ByVal Value2 As Integer)
3:
Dim Result As Integer
4:
5:
Result = Value1 + Value2
6:
7: Return Result
8:
9:
End Function
End Class
TestComplete code is :
Function CallDLLRoutine()
' Defines the dll types
Set Def_DLL1 = DLL.DefineDLL("ClassLibrary1")
Call Def_DLL1.DefineProc("AddMyValues",vt_i4,vt_i4,vt_i4)
Call Def_DLL1.DefineAlias("AddMyValuesOne", "AddMyValues")
Set Lib1 = DLL.Load("C:\TestComplete\ClassLibrary1.dll")
result = Lib1.AddMyValuesOne(2,2)
End Function
I am getting an error :
Object doesn't support this property or method: 'Lib1.AddMyValuesOne'
Error location:
Unit: "GmailKeywordTest\GmailKeywordTest\Script\Unit1"
Line: 12 Column: 5.
I dont know what is wrong with the code.Followed all steps mentioned in TestComplete help.
Any suggestions.
Thanks,
Neha