different calling convention? 
Posted: 15 September 2007 10:51 AM   [ Ignore ]
Rank
Joined  2007-01-25
Total Posts:  8
New Member

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.

Profile
 
 
Posted: 18 September 2007 08:02 AM   [ Ignore ]   [ # 1 ]
Rank
Joined  2007-01-25
Total Posts:  8
New Member

I think the problem can be related with version of touch.lib & touchlib.h & touchlib.dll something frecuent in old days of computing & lowlevel programming.

I can´t find a download with headers and library (release & debug version of .lib and .dll).
Can anyone please attach here a complete binary version of the library for development or send it to me by personal email?
(source code is not enough because it is required to download other packages… compile them...)

I need:
- touchlib header files (to be sure that definitions match the SVN version)
- touchlib.lib & touchlibd.lib (to be linked to my wrapper and requiered to build any application without compiling the library again)
- touchlib.dll & touchlibd.dll to run and debug the wrapper and applications.
- binaries for Windows platform only.

thankyou very much for reading and for any person that take the time to help me, sending the files to aleReimondo at smalltalking dot net

cheers,
Ale.
http://www.aleReimondo.com
http://www.smalltalking.net
http://www.aleReimondo.com.ar

Profile
 
 
Posted: 18 September 2007 11:30 AM   [ Ignore ]   [ # 2 ]
Avatar
RankRankRank
Joined  2007-03-13
Total Posts:  371
Sr. Member

hi, i wrote a .NET wrapper for touchlib. I only used TouchScreenDevice.h. Why do you need the debug versions of the .lib and .dll?

i have included in the zip, the touchlib headers, touchlib.dll, touchlib.lib and the binaries. (all from rev 58) i haven’t compiled the latest version yet.

get the zip -> http://www.whitespaced.co.za/ftir/touchlib-58.zip

i did try to attach the zip but i get “Error Message:  The uploaded file exceeds the maximum allowed size in your PHP configuration file”. the zip is about 2.5mb

 Signature 

the all new Multitouch South Africa http://www.multitouchsa.co.za
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 18 September 2007 05:23 PM   [ Ignore ]   [ # 3 ]
Rank
Joined  2007-01-25
Total Posts:  8
New Member

Only to say that it worked with the help of the file that Donovan attached.
I think that the error was triggered by a version problem between the binary of the dll, and the lib file.

thanks!
Ale.

Profile
 
 
Posted: 18 September 2007 05:38 PM   [ Ignore ]   [ # 4 ]
Avatar
RankRankRank
Joined  2007-03-13
Total Posts:  371
Sr. Member

great! glad it works

 Signature 

the all new Multitouch South Africa http://www.multitouchsa.co.za
those that say it can’t be done shouldn’t interrupt those doing it

Profile