Paste the Template Code
April 3, 2000
The next thing you need to do it paste the template
code in at the very end of the WebMail.pm file [
after the line that reads "1;" ].
You are now almost ready for PerlCtrl to weave its
magic. You have 2 options open to you. Either you
can generate a freestanding COM component, or you
can generate a dependent COM component. A
freestanding component has everything that
it needs packaged up inside it, including a
Perl interpreter. A dependent one does not,
and as such needs to be used on a machine
with Perl installed on it.
The freestanding component will be larger than
the dependent one.
Before you create your COM component within its DLL,
you have to cater to the fact that, at the time of
writing, version 1.2.4 of the PDK has a bug in it.
The kit cannot deal, according to ActiveState, with
lines of Perl that use require statements of the form:
require "aModule.pm";
These need to appear as:
require aModule;
[ which in any event, assumes
that aModule is a ".pm" file anyway ].
So you need to alter line 8 of Mail::Sender
from
require "Exporter.pm"
to
require Exporter;
If you do not, the PDK is going to end up generating
a faulty COM object, and you are going to drive yourself
insane trying to work out what is wrong with it. Trust
us - we speak from experience.
To generate the DLL, type PerlCtrl.pl -f WebMail.pm to
generate a freestanding component, or -d for a dependent
one.
If you receive the message:
Creating PerlCtrl WebMail.dll ...
Your license has expired. Please purchase
a license from http://www.ActiveState.com
The PerlCtrl Builder will now shutdown...
PerlCtrl ERROR: BeginCreatePerlCtrl() failed
Then you need to obtain a new license key from the
ActiveState site in order to run PerlCtrl. It is
available free from the ActiveState site, and will
be sent to you via email as a self-installing exe.
Run the file to install the license.
The URL you need to visit to obtain the license is:
https://www.ActiveState.com/cgibin/license/pdk12/newtrial.pl
The build process will produce output that looks like this:
WebMail.pm syntax OK
Creating PerlCtrl WebMail.dll ...
Adding Module:
C:/APPS/ActivePerl/site/lib/MIME/QuotedPrint.pm
Adding Module:
C:/APPS/ActivePerl/lib/Symbol.pm
Adding Module:
C:/APPS/ActivePerl/lib/re.pm
Adding Module:
C:/APPS/ActivePerl/lib/Fcntl.pm
Adding Module:
C:/APPS/ActivePerl/lib/Exporter.pm
Adding Module:
C:/APPS/ActivePerl/lib/strict.pm
Adding Module:
C:/APPS/ActivePerl/site/lib/MIME/Base64.pm
Adding Module:
C:/APPS/ActivePerl/lib/vars.pm
Adding Module:
C:/APPS/ActivePerl/site/lib/Win32/OLE/Lite.pm
Adding Module:
C:/APPS/ActivePerl/lib/SelectSaver.pm
Adding Module:
C:/APPS/ActivePerl/site/lib/Win32/OLE.pm
Adding Module:
C:/APPS/ActivePerl/lib/IO/Seekable.pm
Adding Module:
C:/APPS/ActivePerl/lib/DynaLoader.pm
Adding Module:
C:/APPS/ActivePerl/lib/auto/DynaLoader/dl_expandspec.al
Adding Module:
C:/APPS/ActivePerl/lib/auto/DynaLoader/dl_findfile.al
Adding Module:
C:/APPS/ActivePerl/lib/auto/DynaLoader/dl_find_symbol_anywhere.al
Adding Module:
C:/APPS/ActivePerl/lib/auto/DynaLoader/autosplit.ix
Adding Module:
C:/APPS/ActivePerl/lib/Carp.pm
Adding Module:
C:/APPS/ActivePerl/lib/IO/File.pm
Adding Module:
C:/APPS/ActivePerl/lib/Socket.pm
Adding Module:
C:/APPS/ActivePerl/lib/File/Basename.pm
Adding Module:
C:/APPS/ActivePerl/lib/FileHandle.pm
Adding Module:
C:/APPS/ActivePerl/lib/integer.pm
Adding Module:
C:/APPS/ActivePerl/lib/AutoLoader.pm
Adding Module:
C:/APPS/ActivePerl/site/lib/PerlCOM.pm
Adding Module:
C:/APPS/ActivePerl/site/lib/Mail/Sender.pm
Adding Module:
C:/APPS/ActivePerl/lib/IO/Handle.pm
Adding Binary:
C:/APPS/ActivePerl/site/lib/auto/MIME/Base64/Base64.dll
Adding Binary:
C:/APPS/ActivePerl/lib/auto/Socket/Socket.dll
Adding Binary:
C:/APPS/ActivePerl/lib/auto/Fcntl/Fcntl.dll
Adding Binary:
C:/APPS/ActivePerl/site/lib/auto/Win32/OLE/OLE.dll
Adding Binary:
C:/APPS/ActivePerl/lib/auto/IO/IO.dll
all done.
[ although it will be a lot shorter if you are
building a dependent COM component, seeing as
the assumption will be made that all the modules
required for the component will be installed on
the machine where it is going to be used. ].
The result of this operation will be the creation
of a DLL called WebMail.dll, containing your COM component.
Datatypes
Introduction to Perl on Windows - Table of Contents
Register Your Component
|