Skip to content

Struct with 3 booleans #65

@pinguin999

Description

@pinguin999

I send a struct with 3 booleans from C# to C++ with PINVOKE.

There is no example for this.
But you have to add [MarshalAs(UnmanagedType.I1)] to get the right size. Otherwise the values are not correct on the C++ side.

Example:

public struct Bla
{
        public float fooFloat;
        [MarshalAs(UnmanagedType.I1)] public bool foo1;
        [MarshalAs(UnmanagedType.I1)] public bool foo2;
        [MarshalAs(UnmanagedType.I1)] public bool foo3;
}

Can you add a example for that in PInvokeLib?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions