Here is the perl code for that's inside the generated dll
package Hello;
sub Hello {
return "Hello, World";
}
=pod
=begin PerlCtrl
%TypeLib = (
PackageName => 'Hello',
# DO NOT edit the next 3 lines.
TypeLibGUID => '{E91B25C6-2B15-11D2-B466-0800365DA902}',
ControlGUID => '{E91B25C7-2B15-11D2-B466-0800365DA902}',
DispInterfaceIID=> '{E91B25C8-2B15-11D2-B466-0800365DA902}',
ControlName => 'HelloWorldControl',
ControlVer => 1,
ProgID => 'Hello.World',
DefaultMethod => '',
Methods => {
'Hello' => {
RetType => VT_BSTR,
TotalParams => 0,
NumOptionalParams => 0,
ParamList =>[ ]
},
}, # end of 'Methods'
Properties => {
}
, # end of 'Properties'
); # end of %TypeLib
=end PerlCtrl
=cut
and here is the VB code that would access it:
Dim objHello
Set objHello = CreateObject("Hello.World")
MsgBox objHello.Hello
Seems fairly simple but I'm having a brain cramp or something :)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.