Hi, Subbiya -
Are you running this app in 32-bit or 64-bit? If you are using 64-bit, can you test in 32-bit to see if it works?
The error appears to occur when the SetPrinter Windows API function is called. If I were to guess, I'd say the issue may be related to the structure that is passed by reference to this API. The value 2 that is passed as the second argument to this API function indicates that a PRINTER_INFO_2 structure is to be passed, which you did not provide in your post.
This object/code is pretty old (roughly 25 years) and passes character and string information in ANSI instead of Unicode, but someone has made changes to switch the datatype of Windows handles to Longptr.
Are you able to zip the exported source for the n_powerwhizz object and a small test app that exhibits the problem issue? If so, I can take a look and try to find the problem in my spare time.
Best regards, John