PerlNet to VB App...
by Vasudevan, Geetha other posts by this author
Dec 7 2004 5:44PM messages near this date
view in the new Beta List Site
Re: PerlNet to VB App...
|
a perl script in a Win CE/ ARM environment
This is a multi-part message in MIME format.
------_=_NextPart_001_01C4DC84.7143E5B0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
=20
I am trying to do the following. Passing a filename from a VB main app
to a perl package and return some value from the perl back to the VB
main app. Obviously I am not doing it right. Any help would be
appreciated. Thanks.
=20
The filename I pass from the VB Main APP to the perl module is not
working. It has an "" for the filename when I use the quick eval in the
Active State Visual Perl debugger.=20
=20
________________________________________________________________________
___________
=20
In the form.vb,=20
=20
Public Shared Sub main()
=20
Dim obj As ParserDLL =3D New ParserDLL
Dim fileN As String =3D "E:\MyDir\Parser\F01.dat"
Dim report As String
=20
report =3D obj.Process1(fileN) =20
=20
Debug.WriteLine("REPORT" & vbNewLine)
Debug.WriteLine(report)
=20
End Sub
=20
########### Returns Nothing.=20
=20
=20
=20
# ParserDLL --=20
#
package ParserDLL;
=20
use strict;
use namespace "System";
use namespace "System.IO";
use PerlNET qw(AUTOCALL);
=20
use FileParser; ## this is an external
FileParser.dll copied in Perl\site\lib and used here directly...
=20
=20
##############
=3Dfor interface
[interface: pure]
str Process1(str filename);
str Ver;
=3Dcut
=20
require FileParser;
=20
##############
sub Process1 {
=20
my ( $datFname, $file, $Ver );=20
$datFname =3D @_;=20
=20
$file =3D new FileParser::File_Resfile($datFname);
$Ver =3D $file-> getResultVer();
return $Ver;
=20
}
1;
## End_of_Package=20
=20
=20
------_=_NextPart_001_01C4DC84.7143E5B0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<?xml version=3D"1.0" ?>
<html>
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
p
{margin-right:0in;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.emailstyle18
{font-family:Arial;
color:navy;}
span.EmailStyle19
{font-family:Arial;
color:navy;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dblue>
<div class=3DSection1>
<p class=3DMsoNormal> <font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'> </span></font></p>
<p class=3DMsoNormal> <font size=3D3 color=3Dnavy face=3D"Times New =
Roman"> <span
style=3D'font-size:12.0pt;color:navy'> I am trying to do the following. =
Passing a
filename from a VB main app to a perl package and return some value from =
the
perl back to the VB main app. Obviously I am not doing it right. Any =
help would
be appreciated. Thanks.</span> </font></p>
<p class=3DMsoNormal> <font size=3D3 color=3Dnavy face=3D"Times New =
Roman"> <span
style=3D'font-size:12.0pt;color:navy'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> The filename I pass =
from the
VB Main APP to the perl module is not working. It has an "" =
for the
filename when I use the quick eval in the Active State Visual Perl =
debugger. </span> </font></p>
<p class=3DMsoNormal> <font size=3D3 color=3Dnavy face=3D"Times New =
Roman"> <span
style=3D'font-size:12.0pt;color:navy'> </span></font></p>
<p class=3DMsoNormal> <font size=3D3 color=3Dnavy face=3D"Times New =
Roman"> <span
style=3D'font-size:12.0pt;color:navy'> ___________________________________=
________________________________________________</span> </font></p>
<p class=3DMsoNormal> <font size=3D3 color=3Dnavy face=3D"Times New =
Roman"> <span
style=3D'font-size:12.0pt;color:navy'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> In the form.vb, =
</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> =
Public
Shared Sub main()</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
Dim obj As ParserDLL =3D New ParserDLL</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
Dim fileN As String =3D =
"E:\MyDir\Parser\F01.dat"</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
Dim report As String</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
report =3D obj.Process1(fileN) </span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
Debug.WriteLine("REPORT" & vbNewLine)</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
Debug.WriteLine(report)</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> =
End Sub</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> ########### Returns =
Nothing.
</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> # ParserDLL -- =
</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> #</span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> package =
ParserDLL;</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> use =
strict;</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> use namespace
"System";</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> use namespace
"System.IO";</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> use PerlNET =
qw(AUTOCALL);</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> use
FileParser; &n=
bsp; &nb=
sp;
## this is an external FileParser.dll copied in Perl\site\lib and used =
here
directly...</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> ##############</span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> =3Dfor =
interface</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
[interface: pure]</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
str Process1(str filename);</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
str Ver;</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> =3Dcut</span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> require =
FileParser;</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> ##############</span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> sub Process1 =
{</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>
</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> my ( =
$datFname,
$file, $Ver ); </span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> $datFname =3D =
@_; </span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> $file =3D new
FileParser::File_Resfile($datFname);</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> $Ver &nb=
sp;
=3D $file->getResultVer();</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> return =
$Ver;</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> }</span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> 1;</span></font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier New"'> ## End_of_Package =
</span> </font></p>
<p class=3DMsoNormal style=3D'text-autospace:none'> <font size=3D2 =
face=3D"Courier New"> <span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'> </span></font></p>
<p class=3DMsoNormal> <font size=3D3 color=3Dnavy face=3D"Times New =
Roman"> <span
style=3D'font-size:12.0pt;color:navy'> </span></font></p>
</div>
</body>
</html>
=00
------_=_NextPart_001_01C4DC84.7143E5B0--
Attachments:
unknown1
|