Beispiel #1
0
        /* In case the DLL is not found we need to wrap the methods up with
         * a try/catch.  Also select 32 or 64 bit DLL at this time.  This
         * C# code is compiled as ANYCPU type */
        private int tc_gsapi_revision(ref gsapi_revision_t vers, int size)
        {
            int code = 0;

            try
            {
                if (is64bit)
                {
                    code = gsapi_revision64(ref vers, size);
                }
                else
                {
                    code = gsapi_revision32(ref vers, size);
                }
            }
            catch (DllNotFoundException)
            {
                /* DLL not found */
                String output = "DllNotFoundException: Ghostscript DLL not found";
                gsDLLProblemMain(this, output);
                return(-1);
            }
            catch (BadImageFormatException)
            {
                /* Using 32 bit with 64 or vice versa */
                String output = "BadImageFormatException: Incorrect Ghostscript DLL";
                gsDLLProblemMain(this, output);
                return(-1);
            }
            return(code);
        }
Beispiel #2
0
 private static extern int gsapi_revision64(ref gsapi_revision_t vers, int size);
Beispiel #3
0
 private static extern int gsapi_revision32(ref gsapi_revision_t vers, int size);
Beispiel #4
0
 /* In case the DLL is not found we need to wrap the methods up with
  * a try/catch.  Also select 32 or 64 bit DLL at this time.  This
  * C# code is compiled as ANYCPU type */
 private int tc_gsapi_revision(ref gsapi_revision_t vers, int size)
 {
     int code = 0;
     try
     {
         if (is64bit)
             code = gsapi_revision64(ref vers, size);
         else
             code = gsapi_revision32(ref vers, size);
     }
     catch (DllNotFoundException)
     {
         /* DLL not found */
         String output = "DllNotFoundException: Ghostscript DLL not found";
         gsDLLProblemMain(this, output);
         return -1;
     }
     catch (BadImageFormatException)
     {
         /* Using 32 bit with 64 or vice versa */
         String output = "BadImageFormatException: Incorrect Ghostscript DLL";
         gsDLLProblemMain(this, output);
         return -1;
     }
     return code;
 }