I am not completely sure if I should be using the Win32::API module for accesing the API I am trying to. In the help of the API there is the following description:
 
The PFGAPI is an ActiveX EXE COM object written in Visual Basic 6.  As such, it can be used in conjunction with any programming language that supports COM objects.  The examples that will follow demonstrate using the API functions in VB6.  Sample code demonstrating its use in other programming languages will be available separately. 
 
am I in the right way?
----- Original Message -----
Sent: Wednesday, October 18, 2006 11:49 AM
Subject: Win32::API problems

I am trying to access the method Connect, in the  PGFAPI.exe unsuccessfully.
The code is what follows:
 
#!/usr/bin/perl
 
use Win32::API;
use Win32::Process;
 
#first I check that I am able to create the process:
Win32::Process::Create($obj, "C:\\Program Files\\PFG\\PFGAPI\\PFGAPI.exe",
                                "pddfg",
                                0,
                                NORMAL_PRIORITY_CLASS,
                                ".");
my $pid = $obj->GetProcessID();
print "pid : $pid\n";
#up here everything works fine. It returns a PID
#now I try to call the API method Connect:
 
$obj = new Win32::API('C:\\Program Files\\PFG\\PFGAPI\\PFGAPI.exe', 'Connect()', 'PPPPP', 'V');
$answer = $obj->Call(Ale, 444, 765, 11.123.45.95, 2000);
   
if(not defined $obj) {print "It is not working, sorry...";}
The error says:
 
Can't call method "Call" on an undefined value at...
 
Anybody can help? Which can be the reason of not being able to define the object $obj?
 
 
 


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to