For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2007 > How to set a COM Object property to TRUE









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to set a COM Object property to TRUE
bmw108@gmail.com

2007-09-26, 10:00 pm

Hello,

I am trying to set a WIN32 COM Object bool property true to enable a
validation option.

I can do it in VB like so.

emailPtr.CorrectSyntax = True

How do I do it in PERL?

I have tried so many different things to no avail.

$emailObj->{MxLookup} = (TRUE);
$emailObj->{MxLookup} = $TRUE;
$emailObj->{MxLookup} = 1;
$emailObj->{MxLookup} = TRUE;

Can anyone help?

Jenda Krynicky

2007-09-26, 10:00 pm

From: bmw108@gmail.com
> I am trying to set a WIN32 COM Object bool property true to enable a
> validation option.
>
> I can do it in VB like so.
>
> emailPtr.CorrectSyntax = True
>
> How do I do it in PERL?
>
> I have tried so many different things to no avail.
>
> $emailObj->{MxLookup} = (TRUE);
> $emailObj->{MxLookup} = $TRUE;
> $emailObj->{MxLookup} = 1;
> $emailObj->{MxLookup} = TRUE;


Try
$emailObj->{MxLookup} = -1;
# yes, CInt(True) == -1

or
use Win32::OLE::Variant;
$emailObj->{MxLookup} = Variant(VT_BOOL, -1);

HTH, Jenda
===== Jenda@Krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com