Thread: what does this error mean...?

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    what does this error mean...?

    What does this error mean?


    24 C:\Documents and Settings\Alex\Desktop\test.cpp initializer list being treated as compound expression


    Here is my code and were it apears...


    Code:
    #include <iostream.h>
    #include <windows.h>
    
    int main()
    {
        int a;
        int b;
        
        
        BOOL GetSystemRegistryQuota(a, b);  //error happens here.
        
        cout<<a;
        
        cout<<b;
        
        cin.get();
    }

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    That's not how you call a function. Try this instead:

    Code:
    #define _WIN32_WINNT 0x0501
    
    #include <iostream.h>
    #include <windows.h>
    
    
    
    int main()
    {
    	DWORD a;
    	DWORD b;
        
        
    	if(!GetSystemRegistryQuota(&a, &b)) 
    	{
    		// function failed
    		return 0;
    	}
        
    	cout<<a<<endl;
        
    	cout<<b<<endl;
        
    	cin.get();
    
    	return 0;
    }
    EDIT: I cant spell
    Last edited by bithub; 09-16-2004 at 03:33 PM.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    It helps a lot to read the documentation for the function you are trying to call.

  4. #4
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    lol the code still didn't work. I am missing a header file or something.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    All you need is windows.h
    Make sure you have the define like in my code (make sure the define is before you include windows.h)

  6. #6
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    lol dude I copied and pasted the code. I looked over and did everything I can think of to make it work.

    It doesn't work some reason.

  7. #7
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    Well it should.

    What compiler/platform SDK?

  8. #8
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    uhh dev-cpp latest version. With mingy or what ever it is called. SDK not sure.

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    lol dude I copied and pasted the code. I looked over and did everything I can think of to make it work.

    It doesn't work some reason.
    I assume you did remember to select "Windows Application" when you made the project. Would I be correct in doing so?

Popular pages Recent additions subscribe to a feed