And the problem is that there I two errors: 1. C:\Documents and Settings\admin\Pulpit\to i tamto\key\main.cpp|13|error: a function-definition is not allowed here before '{' token|
2. C:\Documents and Settings\admin\Pulpit\to i tamto\key\main.cpp|28|error: expected '}' at end of input|
Does anyone know what could be causing this ?
For clarity, I'm sorry for the spelling mistakes but I'm Polish.
You can't define one function inside other one, you can only call one function from another, but here you have defined LowLevelKeyboarProc function inside main, so that is error. Define it outside of main, then try compiling again.
Also there is an error in line 23, VK_A must be before :
Thanks!
But the revised code after you came to me 4 errors:
1. C:\Documents and Settings\admin\Pulpit\to i tamto\key2\main.cpp|30|error: declaration of 'int wPARAM' shadows a parameter|
2. C:\Documents and Settings\admin\Pulpit\to i tamto\key2\main.cpp|34|error: 'wParam' was not declared in this scope|
3. C:\Documents and Settings\admin\Pulpit\to i tamto\key2\main.cpp|38|error: 'VK_A' cannot appear in a constant-expression|
4. C:\Documents and Settings\admin\Pulpit\to i tamto\key2\main.cpp|38|error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'|
1. LRESULT CALLBACK LowLevelKeyboardProc( int nCode, WPARAM wPARAM, LPARAM lPARAM)
...Should be... LRESULT CALLBACK LowLevelKeyboardProc( int nCode, WPARAM wParam, LPARAM lParam)
2. -> See 1.
3. -> Try to substitute VK_A with 'A' (VK_A does not exist).
4. -> Try to substitute out << "A"; with cout << "A";
EDIT: The example above will print an 'A' to the console every time it is pressed.
I UNDERSTAND that the keys will be completed only when the write their entire program right?
Because at the moment the console window after the compiler will not start. As to missing features ("system pause"), but I do not know