Jump to content

Win32_Printer class


Recommended Posts

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.”

 

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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.”

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...