Generate the Template
April 3, 2000
|
Part Three of Introduction to Perl on Windows takes the simple
component and uses the Active State package to actually register
your COM component with the Win32 registry so that you can start
to use it from any COM-aware program.
|
Generate the template by typing "PerlCtrl.pl -t" at
the command line. The result ought to look something like this:
=POD
=BEGIN PerlCtrl
%TypeLib = (
PackageName =>
'MyPackage::MyName',
TypeLibGUID =>
'{32E6513E-DF20-11D3-B454-00805F9BDE4A}', #do NOT edit line
ControlGUID =>
'{32E6513F-DF20-11D3-B454-00805F9BDE4A}', #do NOT edit line
DispInterfaceIID=>
'{32E65140-DF20-11D3-B454-00805F9BDE4A}', #or this one
ControlName =>
'MyApp.MyObject',
ControlVer =>
1, # increment if new object with same ProgID
# create new GUIDs as well
ProgID => 'MyApp.MyObject',
DefaultMethod => 'MyMethodName1',
Methods => {
'MyMethodName1' => {
RetType => VT_I4,
TotalParams => 5,
NumOptionalParams => 2,
ParamList =>[ 'ParamName1' => VT_I4,
'ParamName2' => VT_BSTR,
'ParamName3' => VT_BOOL,
'ParamName4' => VT_I4,
'ParamName5' => VT_UI1 ]
},
'MyMethodName2' => {
RetType => VT_I4,
TotalParams => 2,
NumOptionalParams => 0,
ParamList =>[ 'ParamName1' => VT_I4,
'ParamName2' => VT_BSTR ]
},
}, # end of 'Methods'
Properties => {
'MyIntegerProp' => {
Type => VT_I4,
ReadOnly => 0,
},
'MyStringProp' => {
Type => VT_BSTR,
ReadOnly => 0,
},
'Color' => {
Type => VT_BSTR,
ReadOnly => 0,
},
'MyReadOnlyIntegerProp' => {
Type => VT_I4,
ReadOnly => 1,
},
}, # end of 'Properties'
); # end of %TypeLib
=END PerlCtrl
=cut
Looks nastier than it really is. The most important thing to
remember is that ALL the above is generated automatically,
and you actually must modify very little in order
to make the standard template reflect the functionality of
the WebMail class.
The Perl Code
Introduction to Perl on Windows - Table of Contents
The Steps Needed to Customize the Template
|