A
A
Alexander Smagin2021-08-31 16:12:51
C++ / C#
Alexander Smagin, 2021-08-31 16:12:51

How to marshal such structure?

Good afternoon.
There is such a structure

typedef struct DOUBLEPOINT   
{
  union { double X; double x; };
  union { double Y; double y; };

  void operator = (double value)  {         x  = value;   y  = value;  }
  int operator != (double value)  { return (x != value || y != value); }
  int operator == (double value)  { return (x == value && y == value); }
}
  DOUBLEPOINT;

to be passed by reference to unmanaged code.
How to declare it correctly in C#?
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
        public struct DOUBLEPOINT
        {
            public double x;
            public double y;
            ...
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Griboks, 2021-09-01
@Paxorin

There was an error elsewhere.

It turns out that the issue is resolved - we close it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question