LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Win32 API GetPrinter function help

Solved!
Go to solution

Sounds good. I tried to make a cluster containing the above suggestion for LabVIEW 32 (which is what I am running).

It returns error 116, LabVIEW:  Unflatten or byte stream read operation failed due to corrupt, unexpected, or truncated data.

 

I created a cluster with LPSTR as strings, unsigned 32 bit for the DWORD data types and Unsigned 32 for the pointers.

I made a simple VI to take the array pointer and convert it to the cluster, attached.

Veni Vidi Duci
0 Kudos
Message 21 of 24
(1,311 Views)

Please read more carefully. ALL the pointer types - anything labeled as LP* or P*, which includes LPSTR - should be represented in the cluster as a pointer-sized integer (32- or 64-bits). Getting any data out of those pointers is complicated, but since you only want the numeric cJobs you shouldn't have to deal with that.

0 Kudos
Message 22 of 24
(1,304 Views)

Got it now. Thanks.

Veni Vidi Duci
0 Kudos
Message 23 of 24
(1,296 Views)

If you are doing this solely to get the number of jobs, you should try .NET:

 

GetPrinterJobs.png

 

 

0 Kudos
Message 24 of 24
(1,278 Views)