public static string SPCSGetError(ADKERROR error, ADK_ERROR_TEXT_TYPE errorType) { string str = new string(' ', 256); SPCSAPI.AdkGetErrorText(ref error, (int)errorType, ref str, 256); return str; }
public static void SPCSTry(ADKERROR error, string message) { Console.WriteLine("OK: {0}", message); if (error.lRc != 0) { string errorMessage = SPCSGetError(error, ADK_ERROR_TEXT_TYPE.elRc); throw new Exception(string.Format("SPCS: {0} => {1} ({2})", message, errorMessage, error.lRc)); } }
public static unsafe extern void AdkGetErrorText(ref ADKERROR err, int nErrorTextType, ref string achBuf, int ILen);