Win32:API Printer call - Can anyone fix this (PLEASE READ) 
Author Message
 Win32:API Printer call - Can anyone fix this (PLEASE READ)

New to Windows.  I got some API calls to work but not this one:

use Win32::API;

$function1 = new Win32::API("winspool.drv","OpenPrinter",[P,N,P],N);
$val1 ="\x00"x1024;
$val2 =(0) x 4;
$PRINTER = (0) x 4;
$return = $function1->Call($val1,$PRINTER,$val2);
print "$return == $PRINTER\n";

If you can run/fix this please post and/or write me.  Thanks.



Mon, 19 Aug 2002 03:00:00 GMT  
 Win32:API Printer call - Can anyone fix this (PLEASE READ)
Hello,

This is what I am exactly trying to do.
The problems with your snippet I found are:

1. Use "Winspool" instead of winspool.drv
2. Use [P,P,P] instead of [P,N,P]

I did all this, but when I run my code I am getting the error:
" Can't call method "Call" without a package or object reference at win32.pl
line 12. "

I realized that the API.PM does not have "Call" method.
I have downloaded WIN32::API from http://dada.perl.it/

If anyone else have downloaded from anywhere else, please let me know.

If anyone already knows about this problem/solution to it please let me
know.

Thanx.
Regards
-Lalit

Quote:

>New to Windows.  I got some API calls to work but not this one:

>use Win32::API;

>$function1 = new Win32::API("winspool.drv","OpenPrinter",[P,N,P],N);
>$val1 ="\x00"x1024;
>$val2 =(0) x 4;
>$PRINTER = (0) x 4;
>$return = $function1->Call($val1,$PRINTER,$val2);
>print "$return == $PRINTER\n";

>If you can run/fix this please post and/or write me.  Thanks.



Sun, 25 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Win32:API Printer call - Can anyone fix this (PLEASE READ)

2. Win32:API Printer call - Can anyone fix this (PLEASE READ)

3. Please help, my WIN32::API script cant run after upgrading ActivePerl5.22 to 6.23

4. Please help, my WIN32::API script cant run after upgrading ActivePerl5.22 to 6.23

5. How to make ODBC API calls with WIN32::0DBC (ODBC.PM)

6. Win32::API - calls that write to own memory

7. Trouble calling AddPrinterDriver from Win32::API

8. Win32::API Call Problem

9. Newbie: passing a null string to a Win32 api call

10. calling a Win32 API function from a Perl script

11. WIN32 api call from Perl

12. win32::api and win32::gui

 

 
Powered by phpBB® Forum Software