예제 #1
0
파일: ghostsharp.cs 프로젝트: critor/nPDF
        private int tc_gsapi_set_stdio(IntPtr instance, gsStdIOHandler stdin,
                                       gsStdIOHandler stdout, gsStdIOHandler stderr)
        {
            int code;

            try
            {
                if (is64bit)
                {
                    code = gsapi_set_stdio64(instance, stdin, stdout, stderr);
                }
                else
                {
                    code = gsapi_set_stdio32(instance, stdin, stdout, stderr);
                }
            }
            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);
        }
예제 #2
0
파일: ghostsharp.cs 프로젝트: critor/nPDF
        public ghostsharp()
        {
            /* Determine now if we are 64 or 32 bit */
            is64bit = Environment.Is64BitOperatingSystem &&
                      Environment.Is64BitProcess;
            m_worker   = null;
            gsInstance = IntPtr.Zero;

            /* Go ahead and do the assignment here */
            RaiseStdInCallback  = StdInCallback;
            RaiseStdOutCallback = StdOutCallback;
            RaiseStdErrCallback = StdErrCallback;
        }
예제 #3
0
 public static extern int gsapi_set_stdio_with_handle(IntPtr instance,
                                                      gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr, IntPtr caller_handle);
예제 #4
0
 public static extern int gsapi_set_stdio(IntPtr instance,
                                          gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr);
예제 #5
0
파일: ghostsharp.cs 프로젝트: critor/nPDF
 private static extern int gsapi_set_stdio32(IntPtr instance,
                                             gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr);
예제 #6
0
        private static extern int gsapi_set_stdio64(IntPtr instance,
			gsStdIOHandler stdin, gsStdIOHandler stdout, gsStdIOHandler stderr);
예제 #7
0
        public ghostsharp()
        {
            /* Determine now if we are 64 or 32 bit */
            is64bit = Environment.Is64BitOperatingSystem &&
                Environment.Is64BitProcess;
            m_worker = null;
            gsInstance = IntPtr.Zero;

            /* Go ahead and do the assignment here */
            RaiseStdInCallback = StdInCallback;
            RaiseStdOutCallback = StdOutCallback;
            RaiseStdErrCallback = StdErrCallback;
        }
예제 #8
0
        private int tc_gsapi_set_stdio(IntPtr instance, gsStdIOHandler stdin, 
			gsStdIOHandler stdout, gsStdIOHandler stderr)
        {
            int code;
            try
            {
                if (is64bit)
                    code = gsapi_set_stdio64(instance, stdin, stdout, stderr);
                else
                    code = gsapi_set_stdio32(instance, stdin, stdout, stderr);
            }
            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;
        }