// Try:
[DllImport("XNHInterface.dll"", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
static extern int getPersonInfo(string personNo, string flag, string name, string sex, string birthday, string idCard, string hMaster, string errorMsg);
// call:
int i = getPersonInfo(out personNo,out flag,out name,out sex,out birthday,out idCard,out hMaster,out errorMsg);