Ik ben al een paar weken aan het proberen om in Borland C++ een programma te schrijven voor mijn Logitech G15.
Dit is de code die ik tot nu toe heb, dit is het aanroepen van het lcd scherm.
En nu blijf ik de volgende errors maar krijgen.
Iemand die mij hier toevallig mee kan helpen? Of iemand hier al ervaring mee en mij verder op weg kan helpen?
Alvast bedankt
Bram.
Dit is de code die ik tot nu toe heb, dit is het aanroepen van het lcd scherm.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
| //---------------------------------------------------------------------------
#include <vcl.h>
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include "lglcd.h"
#pragma comment(lib, "lglcd.lib")
using namespace std;
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
void HandleError(DWORD res, LPCTSTR msg)
{
if(ERROR_SUCCESS != res)
{
LPTSTR lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
res,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL);
_tprintf(_T("%s: error 0x%08x occurred:\n%s\n"), msg, res, lpMsgBuf);
LocalFree(lpMsgBuf);
_tprintf(_T("press enter to exit\n"));
_gettchar();
exit(1);
}
}
int main(int argc, char* argv[])
{
DWORD res;
//// initialize the library
res = lgLcdInit();
HandleError(res, _T("lgLcdInit"));
//// connect to LCDMon
// set up connection context
lgLcdConnectContext connectContext;
ZeroMemory(&connectContext, sizeof(connectContext));
connectContext.appFriendlyName = _T("simple sample");
connectContext.isAutostartable = TRUE;
connectContext.isPersistent = TRUE;
// we don't have a configuration screen
connectContext.onConfigure.configCallback = NULL;
connectContext.onConfigure.configContext = NULL;
// the "connection" member will be returned upon return
connectContext.connection = LGLCD_INVALID_CONNECTION;
// and connect
res = lgLcdConnect(&connectContext);
HandleError(res, _T("lgLcdConnect"));
// now we are connected (and have a connection handle returned),
// let's enumerate an LCD (the first one, index = 0)
lgLcdDeviceDesc deviceDescription;
res = lgLcdEnumerate(connectContext.connection, 0, &deviceDescription);
HandleError(res, _T("lgLcdEnumerate"));
// at this point, we have an LCD
_tprintf(_T("Found an LCD with %dx%d pixels, %d bits per pixel and %d soft buttons\n"),
deviceDescription.Width, deviceDescription.Height, deviceDescription.Bpp,
deviceDescription.NumSoftButtons);
return 0;
}
//--------------------------------------------------------------------------- |
En nu blijf ik de volgende errors maar krijgen.
code:
1
2
3
| [Linker Error] Unresolved external 'lgLcdInit' referenced from C:\G15TEST\TEST.OBJ [Linker Error] Unresolved external 'lgLcdConnectA' referenced from C:\G15TEST\TEST.OBJ [Linker Error] Unresolved external 'lgLcdEnumerate' referenced from C:\G15TEST\TEST.OBJ |
Iemand die mij hier toevallig mee kan helpen? Of iemand hier al ervaring mee en mij verder op weg kan helpen?
Alvast bedankt
Bram.