You can use PerlScript from ActiveState and the Microsoft Script Component Wizard.
I'll search for links tomorrow. atm i'm too tired.
| [reply] |
Is there a free alternative or do I have to purchase ActiveState's solution?
| [reply] |
It's entirely free. You need ActivePerl, the Windows Scripting Host ((WSH) comes per default with XP), optionally the Windows Script Component Wizard and the Windows Script 5.6 Documentation.
In a nutshell you create so called .wsc files, that contain code and metainformation so that script code can act as a COM component. the script code can be written in any language the supports the WSH, including Active Perl.
Please see the "PerlScript", "Perlscript Examples" pages of the ActivePerl docs and the examples at \Perl\eg\Windows Script Components.
| [reply] [d/l] |
perlscript comes for free... but PerlCrtl is not free.
perlscript allows you to use wsh stuff... if you can write a control using wsh you can do it in perlscript. ( i dunno if you can)
PerlCtrl is supposed to be a way to wrap full feature COM around perl programs.
| [reply] |
I second holli suggestion. I have used the Windows Script Component-WSC for lots of stuff and it works GREAT and you can even make it a Distributed COM object ( info in MicroSofts WSC docs ). Here is one serious pitfall that will save you some head scratching. The WSC file you create is installed most easily by right clicking the file and then selecting Register. You will also see an option "Generate Type Library". Don't waste your time. The Type Library it creates will throw a exception at runtime if you add it as a reference (in Excel or Word) because the object type defined in the Type Library does not and never could match the object you define in your WSC. MicroSoft acknowledges the problem, but doesn't change the docs or fix the problem...<sigh>. ActiveState's PerlCtrl DOES correctly generate the typelib, so if you need the typelib then purchase the PerlDevKit ( it is a great deal IMO and has lots of great stuff like perlapp and perltray and PerlNET ).
After you read the docs and try the examples, you may wonder how to share a perl hash or array with the MicroSoft world. The key is to use Win32::OLE::Variant and Win32::OLE to create either a VT_ARRAY|VT_VARIANT (use the Put method to store ) or use OLE and CreateObject("Scripting.Dictionary") if you want to use a hash-like object ( and yes, you can save other objects as keys or values) "Scripting.Dictionary" was modeled after Perl hashes I believe.:-)
I have some examples if you need more help. I am too busy right now to post them right now.
Cheers,
JamesNC
| [reply] |
| [reply] |