Home > Net >  Rookie send points and unmanaged DLL, as return parameter PCHAR, written in c #
Rookie send points and unmanaged DLL, as return parameter PCHAR, written in c #

Time:10-03

Unmanaged DLL functions, prototype statement is int func (in PChar, out PChar), mean the previous parameter is input, a parameter is output, after the prototype in DLLIMPORT should how to declare?

CodePudding user response:

Int func (string, StringBuilder)

CodePudding user response:

Char * pchar is c + +?

CodePudding user response:

reference 1st floor stherix response:
int func (string, StringBuilder)

The input string with the string you can understand, why use StringBuilder, as output in the call, isn't this the StringBuilder to initialize, apply for a space? Such as I see you are all use stringBuilder out=new stringBuilder [2048] this form, and then got the output string information?

CodePudding user response:

 int func (string, out StringBuilder) 

CodePudding user response:

reference daiwoo_wang reply: 3/f
Quote: refer to 1st floor stherix response:

Int func (string, StringBuilder)

The input string with the string you can understand, why use StringBuilder, as output in the call, isn't this the StringBuilder to initialize, apply for a space? Such as I see you are all use stringBuilder out=new stringBuilder [2048] this form, and then got the output string information?


This is the.net dllimport will automatically identify the stringbuilder, put it as a string pointer input
With before is to instantiate
  •  Tags:  
  • C#
  • Related