I am using a dll written in c. I have imported all the functions that I need into my C # program. Most of the functions I can work fine, but I have problems with several. The functions I come across require a structure entry. I assume that I need to define this structure in C #, which I did, but I am starting to confuse myself, so I will leave everything I tried. The line is quite long, so I will just look like this: c:
typedef struct chain_link_info
{
unsigned short command;
unsigned long* buff_id;
FLAGS_TYPES flags;
} CHAIN_LINK_INFO;
typedef union flags_type
{
unsigned long ulong;
struct
{
unsigned short std_flags;
unsigned short high
} ushort;
struct
{
unsigned int a : 1;
unsinged int b : 1;
unsinged int c : 1;
unsinged int d : 1;
unsinged int e : 2;
unsinged int f : 1;
unsinged int g : 1;
unsinged int h : 1;
unsinged int i : 1;
unsinged int j : 1;
unsinged int k : 1;
unsinged int l : 1;
unsinged int m : 1;
unsinged int n : 1;
unsinged int o : 1;
unsigned int high_word :16
} std_bits;
} FLAGS_TYPE;
What is the correct way to define these columns in C #? Thanks you
source
share