Sign in to follow this  
Followers 0
Mechaflash

Win32_Printer class

3 posts in this topic

Trying to use the following and looking up the last error code given by the printer

Func _GetLastPrinterError()
    Local $objWMIService, $colItems
    $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
    $colItems = $objWMIService.ExecQuery ('SELECT * FROM Win32_Printer')
    For $objItem in $colItems
        msgbox(0,"",$objItem.LastErrorCode)
    Next
EndFunc

the msgbox() returns an empty string for each printer. Am I supposed to do something to $objItem.LastErrorCode for it to populate correctly? On the MSDN, it tells me that the return value is a UINT32 format value. Not sure if I'm supposed to be doing something special here?


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites



Have you tried msgbox(0,"", int($objItem.LastErrorCode))? Not where I can test it, but I seem to recall having to define it.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

You know what I'm approaching this all wrong... I thought that I could use this as a solution but the last error code of the printer isn't going to help for my situation... I'm going to re-word my question and change the title.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0