How to check success of IGraphics->GetDisplayInfoData()?

This forum is for general developer support questions.
Post Reply
Deniil
Posts: 109
Joined: Mon Jul 11, 2011 6:59 pm

How to check success of IGraphics->GetDisplayInfoData()?

Post by Deniil »

We have this code:

Code: Select all

struct DimensionInfo buf;
ULONG ModeID = getSomeValidScreenMode();
ULONG size = GetDisplayInfoData(NULL, &buf, sizeof(struct DimensionInfo), DTAG_DIMS, ModeID);
if(size==sizeof(struct DimensionInfo)) {
  printf("success\n");
} else {
  printf("failure\n");
}
But it never "succeeds" here. I noticed that sizeof(..Dim..Info)==88 but GetDisplayInfoData() return 66. This may very well be correct behaviour, but what should I check for in my if()?

NOTE also: This code apparently works on MorphOS, but not OS4.1.3.
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: How to check success of IGraphics->GetDisplayInfoData()?

Post by thomasrapp »

Autodocs say that it returns zero in case of failure, so just check for non-zero.
Deniil
Posts: 109
Joined: Mon Jul 11, 2011 6:59 pm

Re: How to check success of IGraphics->GetDisplayInfoData()?

Post by Deniil »

Ok, great.
Post Reply