Home > Net >  C # try to read or write protected memory, this usually indicates other damaged memory. System. Acce
C # try to read or write protected memory, this usually indicates other damaged memory. System. Acce

Time:11-06

Vs2015 DLL library call a function that always quote this error, check the information big could be the problem of parameter transformation between
C + + function:
Int the process (short * pin, int len, char * pout, int & amp; Outlen, long long filepos, bool & amp; Flag)
C # tried the following:
Int the process (ref Int16 pin, int len, ref byte pout, ref int outlen, Int64 filepos, ref bool flag)
Int the process (ref Int16 pin, int len, ref stringBuilder pout, ref int outlen, Int64 filepos, ref bool flag)
Int the process (ref Int16 pin, int len, [MarshalAs (UnmanagedType. LPStr)] StringBuilder pout, ref int outlen, Int64 filepos, ref bool flag)
Will report the same mistakes, do not know where the problem is, the great god, please help solve, thank you thank you!

CodePudding user response:

Int16 pointer IntPtr try instead

CodePudding user response:

Don't need to add the ref, is by value, not preach references,
  •  Tags:  
  • C#
  • Related