Пример #1
0
        public static void ShowDSErrorString(IWin32Window owner, int x)
        {
            int num  = 0;
            int num2 = 0;
            int num3 = 0;

            byte[] buf  = null;
            byte[] buf2 = null;
            byte[] buf3 = null;
            num  = PXCV_Lib36.PXCV_Err_FormatSeverity(x, buf, 0);
            num2 = PXCV_Lib36.PXCV_Err_FormatFacility(x, buf2, 0);
            num3 = PXCV_Lib36.PXCV_Err_FormatErrorCode(x, buf3, 0);
            buf  = new byte[num];
            buf2 = new byte[num2];
            buf3 = new byte[num3];
            string str = "";

            if (PXCV_Lib36.PXCV_Err_FormatSeverity(x, buf, num) > 0)
            {
                str = PXCV_Helper.BytesToString(buf, num);
            }
            str += " [";
            if (PXCV_Lib36.PXCV_Err_FormatFacility(x, buf2, num2) > 0)
            {
                str += PXCV_Helper.BytesToString(buf2, num2);
            }
            str += "]: ";
            if (PXCV_Lib36.PXCV_Err_FormatErrorCode(x, buf3, num3) > 0)
            {
                str += PXCV_Helper.BytesToString(buf3, num3);
            }
            MessageBox.Show(owner, str, "PXCV36 Demo");
        }
Пример #2
0
        public const int PS_ERR_DocNotRead            = unchecked ((int)0x821427b5);  // Document is not read


        public static void ShowDSErrorString(IWin32Window owner, int x)
        {
            int sevLen  = 0;
            int facLen  = 0;
            int descLen = 0;

            byte[] sevBuf  = null;
            byte[] facBuf  = null;
            byte[] descBuf = null;

            sevLen  = PXCV_Lib36.PXCV_Err_FormatSeverity(x, sevBuf, 0);
            facLen  = PXCV_Lib36.PXCV_Err_FormatFacility(x, facBuf, 0);
            descLen = PXCV_Lib36.PXCV_Err_FormatErrorCode(x, descBuf, 0);

            sevBuf  = new byte[sevLen];
            facBuf  = new byte[facLen];
            descBuf = new byte[descLen];

            string s = "";

            if (PXCV_Lib36.PXCV_Err_FormatSeverity(x, sevBuf, sevLen) > 0)
            {
                s = PXCV_Helper.BytesToString(sevBuf, sevLen);
            }
            s += " [";
            if (PXCV_Lib36.PXCV_Err_FormatFacility(x, facBuf, facLen) > 0)
            {
                s += PXCV_Helper.BytesToString(facBuf, facLen);
            }
            s += "]: ";
            if (PXCV_Lib36.PXCV_Err_FormatErrorCode(x, descBuf, descLen) > 0)
            {
                s += PXCV_Helper.BytesToString(descBuf, descLen);
            }
            MessageBox.Show(owner, s, "PXCV36 Demo");
        }