front_idill/extern/fajran-npTuioClient/TestClient/Test.cpp
author bastiena
Thu, 12 Apr 2012 15:33:25 +0200
changeset 28 9ccef81f02ab
parent 27 6c08d4d7219e
permissions -rw-r--r--
Charset set to UTF-8 without bom tab replaced by 4 spaces \r\n replaced by \n in non cs files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     1
/*
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     2
    Modified by alexandre.bastien@iri.centrepompidou.fr to debug this project.
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     3
*/
27
6c08d4d7219e Middleware :
bastiena
parents:
diff changeset
     4
28
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     5
#include <cstdlib>
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     6
#include <cstdio>
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     7
#include <iostream>
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     8
#include <Windows.h>
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
     9
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    10
using namespace std;
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    11
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    12
int main(int argc, char ** argv)
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    13
{
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    14
    /* get handle to dll */
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    15
   HINSTANCE hGetProcIDDLL = LoadLibrary((LPCWSTR)"npTuioClient.dll");
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    16
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    17
   /* get pointer to the function in the dll*/
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    18
   FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_start");
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    19
   FARPROC lpfnGetProcessID2 = GetProcAddress(HMODULE (hGetProcIDDLL),"tuio_stop");
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    20
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    21
   /*
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    22
      Define the Function in the DLL for reuse. This is just prototyping the dll's function.
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    23
      A mock of it. Use "stdcall" for maximum compatibility.
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    24
   */
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    25
   typedef int (__stdcall * pICFUNC)(void);
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    26
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    27
   pICFUNC t;
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    28
   t = pICFUNC(lpfnGetProcessID);
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    29
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    30
   /* The actual call to the function contained in the dll */
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    31
   t();
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    32
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    33
   /* Release the Dll */
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    34
   FreeLibrary(hGetProcIDDLL);
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    35
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    36
    system("PAUSE");
9ccef81f02ab Charset set to UTF-8 without bom
bastiena
parents: 27
diff changeset
    37
    return 0;
27
6c08d4d7219e Middleware :
bastiena
parents:
diff changeset
    38
}