Typedef struct
{
Unsigned int port_address: 12;
Unsigned int port_size: 3;
Unsigned int port_type: 1;
} TS_PORT_CONFIG;
Typedef struct
{
TS_PORT_CONFIG * p_ts_port_config;
Unsigned short c_ts_port_config;
Unsigned short supervision_interval;
} TS_CONFIG;
Extern "C" __declspec (dllexport) unsigned short lp_init (unsigned char ts_id, TS_CONFIG * p_descriptor)
{
Return p_descriptor - & gt; Supervision_interval;
}
In c # how to define the two structure? The key is TS_CONFIG structure inside TS_PORT_CONFIG * don't know how to define,
CodePudding user response:
Struct A{
Struct B
}
Struct B
{
}
So to write, but please pay attention to allocate memory, if you don't feel such insurance can substitute intprt (of course intptr values you have to take to)
CodePudding user response: