/* 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); }
private static extern int gsapi_revision64(ref gsapi_revision_t vers, int size);
private static extern int gsapi_revision32(ref gsapi_revision_t vers, int size);
/* 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; }