Ejemplo n.º 1
0
        internal static int GetLastException(
            out int category,
            out string message,
            out string procedureName,
            out string lineText,
            out int lineNumber,
            out HTuple userData)
        {
            IntPtr message1;
            IntPtr procedureName1;
            IntPtr lineText1;
            IntPtr userData1;
            int    lastException = EngineAPI.HCenGetLastException(out category, out message1, out procedureName1, out lineText1, out lineNumber, out userData1);

            try
            {
                message       = Marshal.PtrToStringAnsi(message1);
                procedureName = Marshal.PtrToStringAnsi(procedureName1);
                lineText      = Marshal.PtrToStringAnsi(lineText1);
                userData      = HalconAPI.LoadTuple(userData1);
            }
            catch
            {
                message       = "Error handling exception";
                procedureName = "";
                lineText      = "";
                userData      = new HTuple();
            }
            EngineAPI.HCenReleaseLastException();
            return(lastException);
        }