----- Original Message ----- From: "Rogers, John" <[EMAIL PROTECTED]> To: "perl-win32-users" <[email protected]> Sent: Tuesday, April 26, 2005 4:32 PM Subject: RE: Win32-API and ghostscript API
Current state of play, can start instance and delete it. But cant exit or use it ! ------------------------------------------------ API.htm has this to say about gsapi_new_instance() : "Create a new instance of Ghostscript. This instance is passed to most other gsapi functions...." It's the first arg that gsapi_new_instance() takes that is the instance being "passed to most other gsapi functions". Now I don't know how, using Win32::API, you're going to "pass" that instance from the gsapi_new_instance() function to any other function. To simplify, for those who don't have access to the functions, consider the following C code (and assume it's valid): void * instance; int retval; // indicates success or failure retval = some_func(&instance); retval = nother_func(instance); ie the function prototypes are: int some_func(void ** instance) and int nother_func(void * instance) and the functions are to be found in the dll called, let's say, 'some_dll.dll'. Can we successfully run both some_func() and nother_func() with Win32::API ? If so, what does the perl code look like ? That's the crux of the matter, as I see it. (I'll try and come up with an answer to that question. Hopefully someone else will beat me to it .... nothing confuses me more than a 'void *'.) On the other hand, it took me all of 5 minutes to get it working with Inline::C. The project amounted to little more than a copy'n'paste of the sample ps2pdf C script that appears in API.htm - a little modification so that the name of the input and output files could be passed (rather than hard-coded in), and I also had to copy the #define of e_Quit from 'ierrors.h'. (I can post that working Inline::C script if anyone wants.) Turns out that, in addition to gsdll32.dll, a plethora of '.ps' files and the font file 'p052023l.pfb' (all of which are included in the gsxxxwin32.exe download) also need to be found. If it turns out that op's needs *can't* be met Win32::API, then I recommend the following (in this order): 1) install 'nmake': Download either: ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe or http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe and run the executable to install nmake into the location of your choice. (Add it's location to your system's path). 2) install 'MinGW': Download http://prdownloads.sf.net/mingw/MinGW-3.1.0-1.exe?download and run the executable to install MinGW to the location of your choice. (Add the location of mingw\bin to your system's path) 3) assuming you're running AS perl, you'll then need to install ExtUtils::FakeConfig, and set perl5lib=-MConfig_m. 4) then install Inline::C (from cpan source, not ppm) and you're away. Thanks John ..... for helping to fill in my arvo :-) Cheers, Rob _______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
