Visual Studio (2005), Qt, MSLLHOOKSTRUCT

Forum for software developers to discuss BCI2000 software development
Locked
timo.veldt
Posts: 23
Joined: 12 Feb 2010, 04:08

Visual Studio (2005), Qt, MSLLHOOKSTRUCT

Post by timo.veldt » 18 Feb 2010, 08:34

[Edit]Sorry if I posted this in the wrong thread, maybe it should go under Known Issues..?[/Edit]

I've been following the instructions on the BCI2000 wiki on how to build BCI2000 using Visual Studio.

General Info:
- Windows XP Professional - SP3
- BCI2000 v3.0
- Microsoft Visual Studio 2005
- Qt 4.6

I have followed all the steps in the wiki page (http://www.bci2000.org/wiki/index.php/P ... ild_System), but I get a few errors and with them a few questions.

I've been able to build the required Qt libs, specified in step 9.2 in the link above. But what am I to do with theses libs? The BCI2000 v3.0 also has qt libs included (in v3.0\src\extlib\qt\msvc\lib) and by the projects that are generated by the batch files in v3.0\build. Building the generated solution gives me linker errors:

Code: Select all

7>QtCored.lib(qfsfileengine_iterator_win.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ)
When overwriting the provided Qt-libs and headers with my own build Qt-libs and corresponding header files, the errors persist.

Apart from that I also get errors in the file KeyLogger.cpp on MSLLHOOKSTRUCT, KBDLLHOOKSTRUCT, WH_KEYBOARD_LL, WH_MOUSE_LL, etc. When searching the internet, only russian and asian pages popped up, which I cannot read.
MSDN tells me that I should find the declarations winuser.h, included through windows.h (which is included in KeyLogger.cpp). However the definition of these structs is grey:

Code: Select all

#if (_WIN32_WINNT >= 0x0400)
/*
 * Low level hook flags
 */

#define LLKHF_EXTENDED       (KF_EXTENDED >> 8)
#define LLKHF_INJECTED       0x00000010
#define LLKHF_ALTDOWN        (KF_ALTDOWN >> 8)
#define LLKHF_UP             (KF_UP >> 8)

#define LLMHF_INJECTED       0x00000001

/*
 * Structure used by WH_KEYBOARD_LL
 */
typedef struct tagKBDLLHOOKSTRUCT {
    DWORD   vkCode;
    DWORD   scanCode;
    DWORD   flags;
    DWORD   time;
    ULONG_PTR dwExtraInfo;
} KBDLLHOOKSTRUCT, FAR *LPKBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;

/*
 * Structure used by WH_MOUSE_LL
 */
typedef struct tagMSLLHOOKSTRUCT {
    POINT   pt;
    DWORD   mouseData;
    DWORD   flags;
    DWORD   time;
    ULONG_PTR dwExtraInfo;
} MSLLHOOKSTRUCT, FAR *LPMSLLHOOKSTRUCT, *PMSLLHOOKSTRUCT;

#endif // (_WIN32_WINNT >= 0x0400)
However the code around it that makes use of of WINVER is not grey:

Code: Select all

#if(WINVER >= 0x0400)
/*
 * Message structure used by WH_CALLWNDPROCRET
 */
typedef struct tagCWPRETSTRUCT {
    LRESULT lResult;
    LPARAM  lParam;
    WPARAM  wParam;
    UINT    message;
    HWND    hwnd;
} CWPRETSTRUCT, *PCWPRETSTRUCT, NEAR *NPCWPRETSTRUCT, FAR *LPCWPRETSTRUCT;

#endif /* WINVER >= 0x0400 */
Any solutions to these problems (either one is fine![/code]

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Post by mellinger » 18 Feb 2010, 09:36

Hi,

BCI2000 V3.0 has not been officially released yet, so its documentation is still inconsistent. Especially, the Programming Reference:Build System wiki page needs updating (for details, see its discussion page: http://www.bci2000.org/wiki/index.php/T ... ild_System).

As you noticed, a version of Qt is now provided with the BCI2000 source code, so you need no longer build Qt yourself.
Unfortunately, I do not have VS 2005 available for testing, and cannot try to reproduce your problem. However, I can successfully build BCI2000 using VS 2008 Express which is freely available from Microsoft (http://www.microsoft.com/downloads/deta ... e26e408569.

Regarding the WINVER and _WIN32_WINNT macros, they should both be set to 0x0500 when targeting Windows 2000 and newer. You might need to manually define them appropriately.
For details on these macros, see
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
and
http://msdn.microsoft.com/en-us/library/6sehtctf.aspx.

HTH,
Juergen

timo.veldt
Posts: 23
Joined: 12 Feb 2010, 04:08

Post by timo.veldt » 19 Feb 2010, 03:19

Thank you for your answer. I downloaded the express edition and it seems to be working.

Can you tell me if there will be VS2005 support in the near future?

Locked

Who is online

Users browsing this forum: No registered users and 0 guests