Hi all,
I am implementing a wrapper of TouchLib to be used with VisualSmalltalk.
I downloaded the library binaries from page and use the binary files found there.
Then downloaded from SVN repository the sources and write
a new DLL project for the wrapper.
The wrapper functions works ok, but when I want to call a function
of the CTouchScreen the following error is triggered in runtime in debug
version (I am linking with the touchlib.lib file found in the sources
downloaded from SVN to avoid compiling the touchlib library
for my project)
“Debug Error !
Program : VDEVW.EXE
Module :
File : i386\chkesp.c
Line : 42
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.”
The error is triggered when calling function saveConfig()
in expressions like the following:
----------------
void
stLoadConfigTouchScreen(ITouchScreen* model, const char* filename)
{ model->loadConfig(filename); }
----------------
(the stLoadConfigTouchScreen function is compiled as __cdecl)
The error appears when calling from C to C++ (it does not occurs in my wrapper, but inside any call to a C++ object exported by touchlib)
I think the problem is in the calling convension used by the loadConfig() function but don´t know how to solve the problem without compiling the library…
Any help or guide to avoid the problem will be really appreciated.
best,
Ale.
