Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Spoolss.EnumJobs problem

  Asked By: Caleb    Date: Apr 29    Category: Java    Views: 847
  

I want to get printer job list in Ms J++ Ver.6.0. I have got printer
list with the code as

follows:


import com.ms.win32.*;
.
.

private void button1_click(Object source, Event e)
{
PRINTER_INFO_2 aPrinterInfo[];
boolean fResult;
boolean fResultDef;
int pcbNeeded[];
int pcReturned[];
aPrinterInfo = new PRINTER_INFO_2[ 200 ];
pcbNeeded = new int[ 1 ];
pcReturned = new int[ 1 ];
fResult = Spoolss.EnumPrinters(winp.PRINTER_ENUM_CONNECTIONS

|winp.PRINTER_ENUM_LOCAL,null,2, aPrinterInfo, 0, pcbNeeded,
pcReturned );
.
.
.

It works done.

I want to use similar function which named EnumJobs as
follows:

private void button2_click(Object source, Event e)
{

JOB_INFO_1 aPJobs[];

boolean fResult;
int pcbNeeded=0;
int pcbNeeded[];
int pcReturned[];
int phandle[];
int phandlenumeric
pcbNeeded = new int[ 1 ];
pcReturned = new int[ 1 ];
phandle=new int [1];
fResult=Spoolss.OpenPrinter("HP DeskJet 610C",phandle,null);
phandlenumeric=phandle[0];

fResult = Spoolss.EnumJobs(phandlenumeric,0,100,1, aPJobs,
0, pcbNeeded,

pcReturned );
.
.
Spoolss.ClosePrinter(phandlenumeric);

When I click button2, I received this error message:

"java.lang.ClassCastException: Instances of java/lang/Object
cannot
be passed via a J/Direct Object parameter."



How can I solve this problem?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Spoolss.EnumJobs problem Or get search suggestion and latest updates.




Tagged: