ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl.net
perl.net
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'> &nbsp;</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'> &nbsp;</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 &quot;&quot; =
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'> &nbsp;</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'> &nbsp;</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"'> &nbsp;</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"'> &nbsp;&nbsp;&nbsp; =
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"'> &nbsp;</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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Dim fileN As String =3D =
&quot;E:\MyDir\Parser\F01.dat&quot;</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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"'> &nbsp;</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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp; report =3D obj.Process1(fileN)&nbsp; </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"'> &nbsp;</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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Debug.WriteLine(&quot;REPORT&quot; &amp; 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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"'> &nbsp;</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"'> &nbsp;&nbsp;&nbsp; =
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"'> &nbsp;</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"'> &nbsp;</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"'> &nbsp;</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"'> &nbsp;</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"'> &nbsp;</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
&quot;System&quot;;</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
&quot;System.IO&quot;;</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"'> &nbsp;</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
## 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"'> &nbsp;</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"'> &nbsp;</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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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"'> &nbsp;</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"'> &nbsp;</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"'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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"'> &nbsp; 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"'> &nbsp;$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"'> &nbsp;</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"'> &nbsp;$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"'> &nbsp;$Ver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
=3D $file-&gt;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"'> &nbsp;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"'> &nbsp;</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"'> &nbsp;</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'> &nbsp;</span></font></p>

</div> 

</body> 

</html> 
=00
------_=_NextPart_001_01C4DC84.7143E5B0--
Attachments:
unknown1


Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved