Forum Discussion

pietromigliore's avatar
11 years ago

Reading a DLL created with C++ is not possible

I have created a Visual Studio 2010 project in C++ which you can find in the attachment.

If you open it there are several functions prepared to do something .. but then not able to make work anything I created two simple functions called:

-  "pietro", which returns a bool by passing a bool

- "testino", which returns an integer by passing an integer

 

Then on Test Complete I created a function like this:

function test()
{
try{

var a, b, DefDLL, DefProc, Lib, Def_Environment
b = 1;

Def_Environment = DLL["DefineEnvironment"]();
DefDLL = Def_Environment["DefineDLL"]("PwServerTester");
DefProc = DefDLL["DefineProc"]("testino", vt_int, vt_int);

Lib = Def_Environment["Load"]("c:\\PwServerTester.dll");

a = Lib["testino"](b)

if (a==1)
  Log["Message"]("Connesso")
delay(1000)

}
  catch(e){
    Log["Error"](e["description"]);
    delay(1000)
  }

It always goes in exception and I am not able to get anything ...
Do you know where could the problem be? Do you have any good example, different from the one in the documentation, which is working? If someone could provide a C++ project base with a TestComplete project, it would be very helpful!

No RepliesBe the first to reply