Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <779F20BCCE5AD31186A50008C75D997917175D@silldn_mail1.sanwaint.com> From: "Fifer, Eric" To: "'John DOT Velman AT HSC DOT com'" , cygwin AT sourceware DOT cygnus DOT com Subject: RE: Accessing perl from VB... Date: Wed, 26 Jul 2000 14:32:26 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01BFF705.EF7467C6" ------_=_NextPart_000_01BFF705.EF7467C6 Content-Type: text/plain; charset="iso-8859-1" John.Velman wrote: >Last spring I desparately needed to use Perl's regular expression >capabilities in a VBA program that was doing transformations on >a huge Excel file. I found that the Active State perl has a perl dll >(and directions for using it), so I installed the Active State perl. I know of a few different ways to go at this, although this is a little off topic for a Cygwin group. + ActiveState Perl (calling from VBA to Perl) + PerlEZ.dll: a simple DLL that can be loaded by VBA and creates a perl interpreter from which you can do most perl things (kinda buggy IMHO). + PerlCOM: exposes Perl as a COM object, from VBA you can do CreateObject, etc. + Microsoft ActiveX Scripting Control: a COM object that provides hooks into Microsoft's scripting engine which in turn can call into PerlScript as well as other languages. + Win32::OLE (calling from Perl to ActiveX) Allow calls from Perl into any ActiveX (aka COM, OLE) object like Excel. Also, works well in combination with the above. The latest Win32-OLE-0.13 compiles relatively cleanly on Cygwin. Attached is a patch that works around a know gcc bug. The Win32::OLE maintainer is aware of the problem, but since it is a gcc bug ... How did you solve your problem? >I'd just as soon de-install the Active State perl. Question: how hard >would it be to get at the perl functions from VBA using libperl5_6_0.dll? I have some patches to Win32::OLE that basically takes the PerlEZ approach of creating a DLL that can be loaded by VBA (only tested with Excel) and has an embedded Perl interpreter. After corresponding with Jan Dubois, the Win32::OLE maintainer, I've been planning to clean it up and upload to CPAN. If your interested, I can try to do this sooner rather than later. Regards, Eric Fifer ------_=_NextPart_000_01BFF705.EF7467C6 Content-Type: application/octet-stream; name="Win32-OLE.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Win32-OLE.patch" diff -ur Win32-OLE-0.13.orig/OLE.xs Win32-OLE-0.13/OLE.xs=0A= --- Win32-OLE-0.13.orig/OLE.xs Wed May 31 02:58:03 2000=0A= +++ Win32-OLE-0.13/OLE.xs Tue Jun 13 10:42:32 2000=0A= @@ -172,13 +172,24 @@=0A= =20 /* DCOM function addresses are resolved dynamically */ HINSTANCE hOLE32; +#if defined(__GNUC__) + HRESULT STDAPICALLTYPE (*pfnCoInitializeEx)(LPVOID, DWORD); + void STDAPICALLTYPE (*pfnCoUninitialize)(void); + HRESULT STDAPICALLTYPE (*pfnCoCreateInstanceEx)(REFCLSID, = IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); +#else FNCOINITIALIZEEX *pfnCoInitializeEx; FNCOUNINITIALIZE *pfnCoUninitialize; FNCOCREATEINSTANCEEX *pfnCoCreateInstanceEx; +#endif =20 /* HTML Help Control loaded dynamically */ HINSTANCE hHHCTRL; +#if defined(__GNUC__) + HWND WINAPI (*pfnHtmlHelp)(HWND hwndCaller, LPCSTR pszFile, + UINT uCommand, DWORD dwData); +#else FNHTMLHELP *pfnHtmlHelp; +#endif =20 } PERINTERP; =20 ------_=_NextPart_000_01BFF705.EF7467C6 Content-Type: text/plain; charset=us-ascii -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com ------_=_NextPart_000_01BFF705.EF7467C6--