Error in winbase.h

Aug 10, 2011 at 9:59am
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
#include <iostream>

//the following line is necessary for the
//  GetConsoleWindow() function to work!
//it basically says that you are running this
//  program on Windows 2000 or higher
#define _WIN32_WINNT 0x0500

//it is important that the above line be typed
//  BEFORE <windows.h> is included
#include <windows.h>

using namespace std;

int main (void)
{
  HWND console = GetConsoleWindow();
  RECT r;
  GetWindowRect(console, &r); //stores the console's current dimensions

  //MoveWindow(window_handle, x, y, width, height, redraw_window);
  MoveWindow(console, r.left, r.top, 800, 600, TRUE);
  for (int j = 0; j < 100; ++j)
    {
      for (int i = 0x41; i < 0x5B; ++i)
        cout << (char)i;
    }
  cout << endl;
  Sleep(1000);
  MoveWindow(console, r.left, r.top, r.right - r.left, r.bottom - r.top, TRUE);
}


this is what i was looking at trying to resise my window. i've done everything it says, but now i get an error in winbase.h, namely this one: fatal error C1012: unmatched parenthesis : missing ')'

now in the library this is the code that has the error:
1
2
3
4
5
6
7
8
#if (_WIN32_WINNT >= 0x0500)
#if defined(_M_ALPHA)
#define MoveMemoryVlm RtlMoveMemory
#define CopyMemoryVlm RtlCopyMemory
#define FillMemoryVlm RtlFillMemory
#define ZeroMemoryVlm RtlZeroMemory
#endif
#endif 


so what do i have to do to fix it?
Aug 10, 2011 at 4:27pm
I'm not sure why that code won't compile on your system. Using the GNU g++ compiler, I just got it to compile fine like this:
1
2
3
4
5
6
7
8
9
10
#if (_WIN32_WINNT >= 0x0500)
#if defined(_M_ALPHA)
#define MoveMemoryVlm RtlMoveMemory
#define CopyMemoryVlm RtlCopyMemory
#define FillMemoryVlm RtlFillMemory
#define ZeroMemoryVlm RtlZeroMemory
#endif
#endif
int main(void){
    return 0; }
Aug 10, 2011 at 4:44pm
yes that piece compiles fine, but when i try to compile the code on top the error pops up
Aug 10, 2011 at 6:44pm
closed account (DSLq5Di1)
What IDE are you using? try updating your Windows SDK,
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3138
Aug 14, 2011 at 7:28am
i installed that and the error is still the same...
Aug 14, 2011 at 7:32am
closed account (DSLq5Di1)
What IDE are you using?

Simply installing the SDK isn't going to change a thing if you don't also update the include and lib paths of your IDE..
Aug 14, 2011 at 10:53am
closed account (zb0S216C)
---[Content Revoked]---

This works perfectly fine. You're SDK is clearly old. Either get a modern IDE, or, update your SDK.

Wazzak
Last edited on Aug 14, 2011 at 11:02am
Topic archived. No new replies allowed.