what does this error mean...?

This is a discussion on what does this error mean...? within the C++ Programming forums, part of the General Programming Boards category; 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 ...

  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,255
    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 04:33 PM.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,255
    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,255
    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
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    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
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    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

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