c ++ c dll appel # dans les paramètres entrants et sortants sur char *

c ++ dll interfaces de prototype: int CheckSN (const char * infolist, char * msg);

c # appels en:

[DllImport ( "sncplusInterface.dll", EntryPoint = "CheckSN", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern int CheckSN (string infolist, StringBuilder msg);

Appel est:

StringBuilder chOutMsg = new StringBuilder (1024);

CheckSN (chData, chOutMsg / * ref chOutMsg * /);

string str = chOutMsg.ToString ();

Avec l'arbitre ou sur mot-clé accident

 

Je suppose que tu aimes

Origine www.cnblogs.com/bigfi/p/12521958.html
conseillé
Classement