* Re: Accessing perl from VB...
@ 2000-07-25 19:48 Danny Smith
0 siblings, 0 replies; 3+ messages in thread
From: Danny Smith @ 2000-07-25 19:48 UTC (permalink / raw)
To: John.Velman, cygwin
>From: John.Velman@HSC.com
>To: cygwin@sourceware.cygnus.com
>Subject: Accessing perl from VB...
>Date: Tue, 25 Jul 2000 15:51:21 -0700
>
>Question: how hard
>would it be to get at the perl functions from VBA using libperl5_6_0.dll?
>
Unless the dll exports are all _stdcall (aka PASCAL) convention, very
difficult. VBA can only import _stdcall functions.
Danny
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Accessing perl from VB...
@ 2000-07-26 6:33 Fifer, Eric
0 siblings, 0 replies; 3+ messages in thread
From: Fifer, Eric @ 2000-07-26 6:33 UTC (permalink / raw)
To: 'John.Velman@HSC.com', cygwin
[-- Attachment #1: Type: text/plain, Size: 1826 bytes --]
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
[-- Attachment #2: Win32-OLE.patch --]
[-- Type: text/x-diff, Size: 949 bytes --]
diff -ur Win32-OLE-0.13.orig/OLE.xs Win32-OLE-0.13/OLE.xs
--- Win32-OLE-0.13.orig/OLE.xs Wed May 31 02:58:03 2000
+++ Win32-OLE-0.13/OLE.xs Tue Jun 13 10:42:32 2000
@@ -172,13 +172,24 @@
/* 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
/* 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
} PERINTERP;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Accessing perl from VB...
@ 2000-07-25 15:51 John.Velman
0 siblings, 0 replies; 3+ messages in thread
From: John.Velman @ 2000-07-25 15:51 UTC (permalink / raw)
To: cygwin
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've had a chance in the last few days, finally, to install cygwin 1.1
properly (apparently -- enscript compiled out of the box), and have
also installed Charles Wilson's perl_5.6.0.
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 apologize if this is documented, but I can't seem to find it.
Thanks,
John Velman
john.velman@hsc.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-07-26 6:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-25 19:48 Accessing perl from VB Danny Smith
-- strict thread matches above, loose matches on Subject: below --
2000-07-26 6:33 Fifer, Eric
2000-07-25 15:51 John.Velman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).