c ++ DLL de C # de llamadas en los parámetros de entrada y salida en char *

DLL de C ++ interfaces del prototipo: int CheckSN (const char * infolist, char * msg);

c # llamadas en:

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

Llamada es:

StringBuilder chOutMsg = new StringBuilder (1024);

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

string str = chOutMsg.ToString ();

Con el árbitro o fuera de choque de palabras clave

 

Supongo que te gusta

Origin www.cnblogs.com/bigfi/p/12521958.html
Recomendado
Clasificación