visual 2010 settings for testing a C dll
Hi,
I am writing a C dll with Visual 2010 and I am not able to test it with TestComplete
The simplest function of this library is "increment" that only returns the input parameter plus 1:
#ifndef mylib_h__
#define mylib_h__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WINDOWS
#ifdef CALLBACKLIBRARY_EXPORTS
#define DLLDIR __declspec (dllexport)
#else
#define DLLDIR __declspec (dllimport)
#endif
#else
#define DLLDIR
#endif
int DLLDIR __stdcall increment(int x);
#ifdef __cplusplus
}
#endif
#endif
In TestComplete, we define a JScript with this code:
function TestSimply()
{
var def_DLL,ret;
// Defines the dll type
def_DLL = DLL["DefineDLL"]("callbacklibrary");
def_DLL["DefineProc"]("increment", vt_int, vt_int);
// Loads the dll.
Lib = DLL["Load"]("C:\\Tests\\callbacklibrary.dll");
//Call the function from the library
ret = Lib["increment"](10);
}
When we run the test, TestComplete shows this error:
"object doesn't support this property or method"
We do not know if it is a bad configuration of Visual or defining test in TestComplete
Could you help me, please?
Thanks in advance
Amparo