Start of touch calibration

Hello,

I have to start touch calibration from within my application. As you describe on the page Touch Screen Calibration (WinCE) | Toradex Developer Center I just have to call the TouchCalibrate() function.
Unfortunately after I added the call to this function, I get linker errors which tell me that the function ist not defined. I read the MSDN page TouchCalibrate (Windows Embedded CE 6.0) | Microsoft Learn but I cannot link against the library mentioned there.

Please tell me what I have to do to start touch calibration from my application.

Best regards,
Florian Pfanner

@fox
Please tell us which operating system, BSP version and module you are using so we can quickly test this. Thanks.

Please, in addition to what Roman asked, please copy also the error message you get when trying to build your code.

Hello Valter,

I created a minimal example, see files attached. The error message shown in Visual Studio:

1>------ Erstellen gestartet: Projekt: TouchCalibrationTest, Konfiguration: Debug Colibri600 (ARMV4I) ------
1>Verknüpfen…
1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "“int cdecl TouchCalibrate(void)" (?TouchCalibrate@@YAHXZ)" in Funktion “main”.
1>corelibc.lib(mainwcrt.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “wmain” in Funktion "“void cdecl mainCRTStartupHelper(struct HINSTANCE *,unsigned short const *)” (?mainCRTStartupHelper@@YAXPAUHINSTANCE
@@PBG@Z)”.
1>Colibri600 (ARMV4I)\Debug/TouchCalibrationTest.exe : fatal error LNK1120: 2 nicht aufgelöste externe Verweise.
1>Das Buildprotokoll wurde unter “file://d:\Projekte\33134_Hematech\TouchCalibrationTest\TouchCalibrationTest\Colibri600 (ARMV4I)\Debug\BuildLog.htm” gespeichert.
1>TouchCalibrationTest - 3 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========

link text

You should declare TouchCalibrate as extern “C”:

extern “C” BOOL WINAPI TouchCalibrate(void);

All Windows APIs are exported with an undecorated name (since they are C not C++), and if you declare them in a C++ file (just the cpp extension is enough to make it C++) you’ve to specify the correct linkage.

Excactly this was the problem!

Thank you very much for your valuable help.
Best regards,
Florian

Hello Roman,

tank you for your quick answer.

I work with a Colibri Tegra T20 with bootloader version 1.2 and image version 1.2 (CE7.0). For development Visual Studio 2008 is used (without platform builder).

Many thanks in advance,
Florian