Code:
void ScreenColorFill(HANDLE hStdout,DWORD Attributes)
{
COORD MaxWindowSize=GetLargestConsoleWindowSize(hStdout);
assert(MaxWindowSize.X&&MaxWindowSize.Y);
DWORD num;
COORD start;
start.X=0;
start.Y=0;
bool test=FillConsoleOutputAttribute(hStdout,Attribute,(MaxWindowSize.X*MaxWindowSize.Y),start,&num);
assert(test);
perror(strerror(GetLastError() ) );
}
When I compile the code I get an assert. The GetLastError() function returns a message not enough space?? The code still fills the screen and errno contains no error. The function is supposed to return non zero on success. Just curious what is going on. Anyone have any ideas?
[edit]
nevermind i figured it out. I actually wrote the correct code here what I was compiling though was
Code:
void ScreenColorFill(HANDLE hStdout,DWORD Attributes)
{
COORD MaxWindowSize=GetLargestConsoleWindowSize(hStdout);
assert(MaxWindowSize.X&&MaxWindowSize.Y);
LPDWORD lpnum; //<-----was using the pointer version instead of DWORD
COORD start;
start.X=0;
start.Y=0;
bool test=FillConsoleOutputAttribute(hStdout,Attribute,(MaxWindowSize.X*MaxWindowSize.Y),start,lpnum);
assert(test);
perror(strerror(GetLastError() ) );
}