front_idill/extern/fajran-npTuioClient/TestClient/Test.cpp
changeset 30 45c889eae324
parent 29 fcf435874395
child 31 2c7fc855eba8
equal deleted inserted replaced
29:fcf435874395 30:45c889eae324
     1 /*
       
     2     Modified by alexandre.bastien@iri.centrepompidou.fr to debug this project.
       
     3 */
       
     4 
       
     5 #include <cstdlib>
       
     6 #include <cstdio>
       
     7 #include <iostream>
       
     8 #include <Windows.h>
       
     9 
       
    10 using namespace std;
       
    11 
       
    12 int main(int argc, char ** argv)
       
    13 {
       
    14     /* get handle to dll */
       
    15    HINSTANCE hGetProcIDDLL = LoadLibrary((LPCWSTR)"npTuioClient.dll");
       
    16 
       
    17    /* get pointer to the function in the dll*/
       
    18    FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_start");
       
    19    FARPROC lpfnGetProcessID2 = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_stop");
       
    20 
       
    21    /*
       
    22       Define the Function in the DLL for reuse. This is just prototyping the dll's function.
       
    23       A mock of it. Use "stdcall" for maximum compatibility.
       
    24    */
       
    25    typedef int (__stdcall * pICFUNC)(void);
       
    26 
       
    27    pICFUNC t;
       
    28    t = pICFUNC(lpfnGetProcessID);
       
    29 
       
    30    /* The actual call to the function contained in the dll */
       
    31    t();
       
    32 
       
    33    /* Release the Dll */
       
    34    FreeLibrary(hGetProcIDDLL);
       
    35 
       
    36     system("PAUSE");
       
    37     return 0;
       
    38 }