Home > Net >  How to define data types, c # call DLL
How to define data types, c # call DLL

Time:05-16

There is a dynamic library, there is a function is as follows:
The dynamic library name: test. DLL
The function name: int testfun (s_struct * dev_handle, int ch_id, t_struct bufs [], int n_bufs);

Among them:
Typedef struct
{
Int device_id;

} s_struct;

Typedef struct
{
Uint8_t * data;
Uint64_t timestamp;
Int data_len;
Uint8_t iface;
} t_struct.

How to call in c #?? Consult,,,,,,,,,,

CodePudding user response:

I think the byte [] for processing, only need to change my line

CodePudding user response:

The.net also have struct unsafe or Marshal

CodePudding user response:

Has not been used for the unsafe and marshal, how to define, can this structure, for example? Thank you for the

CodePudding user response:

The C structure is defined in
Typedef struct
{
Unsigned char * data;
Unsigned long long timestamp;
Int data_len;
Unsigned char iface;
}. How to convert instead???????

CodePudding user response:

3/f thank you comment on the second floor
  •  Tags:  
  • C#
  • Related