How to query interface by Win32::OLE.

2006-05-06 Thread Like Ma
Hi Everyone, I want to communicate with COM, that is the following: coclass CJob { interface IJob; interface ISourceCollection; }; by Win32::OLE like $job = Win32::OLE-new ('SyncService.Job.1') || die Unable to create job.\n; if (Win32::OLE-LastError != 0) { print Unable to new a

RE: How to query interface by Win32::OLE.

2006-05-06 Thread Jan Dubois
On Sat, 06 May 2006, Like Ma wrote: I want to communicate with COM, that is the following: coclass CJob { interface IJob; interface ISourceCollection; }; by Win32::OLE like $job = Win32::OLE-new ('SyncService.Job.1') || die Unable to create job.\n; if (Win32::OLE-LastError != 0) {

Re: How to query interface by Win32::OLE.

2006-05-06 Thread Like Ma
Hi Jan, I am sure that it does. I can call the methods of IJob, but I can't call any method of ISourceCollection. Is there a method in Win32::OLE like QueryInterface in C++ ? Thanks, Like On 5/7/06, Jan Dubois [EMAIL PROTECTED] wrote: On Sat, 06 May 2006, Like Ma wrote: I want to

Re: Win32::OLE::Variant, perl crashing.

2006-05-06 Thread A. Pollock
Sure. if (ref ($sentdate) eq 'Win32::OLE::Variant') { # something with $sentdate-Date } else { # assume $sentdate is a string. } There might be something more efficient one can do with SUPER or AUTOLOAD or something. I've never had the time to figure it out though. - Original

Re: Win32::OLE::Variant, perl crashing.

2006-05-06 Thread Luke Bakken
if (ref ($sentdate) eq 'Win32::OLE::Variant') { # something with $sentdate-Date } else { # assume $sentdate is a string. } Best practice is to use UNIVERSAL::isa() : if (UNIVERSAL::isa($sentdate, 'Win32::OLE::Variant')) { } else { } Tested with: perl -MWin32::OLE::Variant