Memo:
1. The C function parameter is a string char *. If it is an input parameter, it corresponds to string or StringBuilder in C #; if it is an output parameter, it corresponds to StringBuider in C;
2. The C function parameter is a struct pointer, which must be defined in C. For input parameters, myfunction (MyStruct mystruct) or myfunction (ref MyStruct mystruct) can be used in C #. For output parameters, myfunction (ref MyStruct mystruct) is used in C ). When multiple functions use the MyStruct parameter, if one function uses ref, other functions also use ref, whether it is an output parameter or not. Otherwise, a memory error is prompted during running. That is, we should try to ensure the consistency of parameters of the same struct type defined in C.
3. The C function cannot return an array, but can encapsulate the array as a member of the struct. by returning the struct result, the returned array is obtained.
Other references:
Platform call P-INVOKE (1) -- (basic): http://blog.csdn.net/sdl2005lyx/article/details/6796037
Platform call P-INVOKE (2) -- (Mail string):
Http://blog.csdn.net/sdl2005lyx/article/details/6799495
Platform call P-INVOKE (3) -- (Mail structure):
Http://blog.csdn.net/sdl2005lyx/article/details/6801113
Platform call P-INVOKE advanced (1) -- (Mail contains two-dimensional array structure):
Http://blog.csdn.net/sdl2005lyx/article/details/6998969