Funky Error

This is a discussion on Funky Error within the C++ Programming forums, part of the General Programming Boards category; warning C4003: not enough actual parameters for macro 'CreateWindowA' error C2059: syntax error : 'constant' I have a header file ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    411

    Funky Error

    warning C4003: not enough actual parameters for macro 'CreateWindowA'
    error C2059: syntax error : 'constant'

    I have a header file

    Code:
    #include <windows.h>
    
    class cWindowManager {
    public:
    	bool CreateWindow(int width, int height, int bits);
    	bool DestroyWin();
    private:
    	HDC			hdc;	//Device Context
    	HGLRC		hrc;	//Render Context
    	HWND		hwn;	//Window Handle
    	HINSTANCE	hin;	//Instance
    	RECT		rect;	//Screen Rectangle
    	WNDCLASS	wc;		//Window Class
    	DEVMODE		ss;		//Screen Settings
    	DWORD		s;		//Style
    	DWORD		xs;		//Extended Style
    	short		depth;	//Depthbuffer Specification
    	unsigned int pf;	//Pixel Format
    };
    and a source file that defines the function CreateWindow

    Code:
    #include "WindowManager.h"
    
    bool cWindowManager::CreateWindow(int width, int height, int bits) {
    	
    	----code----
    
    }
    The error is flagged in both places where the function is named. This is not an error I have seen before, so I dont know what the deal is.

    MSVC Help says this, but im not getting anywhere.
    Compiler Warning (level 1) C4003
    not enough actual parameters for macro 'identifier'

    The number of actual parameters specified with the given identifier was less than the number of formal parameters given in the macro definition of the identifier.

    When a formal parameter is referenced in the definition and the corresponding actual parameter has not been provided, empty text is substituted in the macro expansion.
    Any ideas? Im using MSVC 6.0 Pro on Windows XP if it matters. It was building fine, then it started giving this error...
    Last edited by Eber Kain; 05-31-2004 at 01:11 PM.

  2. #2
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    I think CreateWindow is already defined in windows.h, so you might try either renaming that function or putting it inside a namespace.
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    doh, I think your right.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 10:15 PM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 02:17 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21