dynastes has asked for the wisdom of the Perl Monks concerning the following question:
use Win32::OLE qw(EVENTS); &Login; &get_news; print "something printed during receiving news title at real time\n"; sub get_news { my $XAReal = Win32::OLE->new('XA_DataSet.XAReal'); $XAReal->SetFieldData('InBlock','nwcode','NWS001'); my $XARealEvents = sub { my ( $obj, $event, @args ) = @_; # 1: OnReceiveRealData if ($event) { my $time = $obj->GetFieldData('OutBlock', 'time'); my $title = $obj->GetFieldData('OutBlock', 'title'); print "[$time] $title\n"; } }; Win32::OLE->WithEvents( $XAReal, $XARealEvents, '{16602768-2C96-4D93-984B-E36E7E35BFBE}', ); $XAReal->AdviseRealData; Win32::OLE->MessageLoop; } sub Login { $XASession = Win32::OLE->new('XA_Session.XASession'); $XASessionEvents = sub { my ($obj, $event, @args) = @_; # 1: OnLogin # 2: OnLogout # 3: OnDisconnect if($event == 1) { print "Login success\n"; Win32::OLE->QuitMessageLoop; } else { die "\nLogin ERROR!\n"; } }; Win32::OLE->WithEvents( $XASession, $XASessionEvents, '{6D45238D-A5EB-4413-907A-9EA14D046FE5}', ); $XASession->Login($user, $pass); Win32::OLE->MessageLoop; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: another code execution during Win32::OLE->MessageLoop
by marinersk (Priest) on Jul 16, 2015 at 17:02 UTC | |
|
Re: another code execution during Win32::OLE->MessageLoop ( SpinMessageLoop
by Anonymous Monk on Jul 16, 2015 at 21:20 UTC |