O'Reilly logo

Win32 Perl Programming: The Standard Extensions, Second Edition by Dave Roth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

OLE Errors

The Win32::OLE extension supplies a method to query any error that the preceding action on a COM object might have produced. Every interaction with a COM object (a call into a method or a query or setting of a property) will set the error state, even if no error was generated. Therefore, you must always query the error state before any other interaction with any COM object.

The error state is obtained with a call into the LastError() method:

Win32::OLE–>LastError(); 

The LastError() method will return a value based on context. If the method is called in a numeric context, the returned value is the reported error number. If the method is called in a string context, the return value is the error text message.

This method always returns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required