Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Foundation BOOLEAN more user-friendly #585

Closed
AArnott opened this issue Jun 15, 2022 Discussed in #584 · 0 comments · Fixed by #586
Closed

Make Foundation BOOLEAN more user-friendly #585

AArnott opened this issue Jun 15, 2022 Discussed in #584 · 0 comments · Fixed by #586
Assignees
Labels
enhancement New feature or request

Comments

@AArnott
Copy link
Member

AArnott commented Jun 15, 2022

Discussed in #584

Originally posted by Slion June 15, 2022
HidD_GetProductString return value is generated as that Foundation.BOOLEAN class. Is there an elegant way to check its value? I tried getting TRUE and FALSE to generate but I don't think that works.

I ended up declaring something like that, still somewhat ugly though:

namespace Windows.Win32
{
    class K
    {
        public static readonly Foundation.BOOLEAN TRUE = new Foundation.BOOLEAN(1);
        public static readonly Foundation.BOOLEAN FALSE = new Foundation.BOOLEAN(0);
    }
}

We have both BOOL and BOOLEAN types (of different lengths) in the metadata. We already take steps in CsWin32 to make BOOL feel as much like bool as possible. We can do the same for BOOLEAN.

@AArnott AArnott added the enhancement New feature or request label Jun 15, 2022
@AArnott AArnott self-assigned this Jun 15, 2022
AArnott added a commit that referenced this issue Jun 15, 2022
@AArnott AArnott changed the title Foundation BOOLEAN Make Foundation BOOLEAN more user-friendly Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant