
Anonymous user
Not applicable
2021-06-09
04:00 PM
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
2021-06-09
04:00 PM
Using the Automation Interface from Perl
Originally published on Geo SCADA Knowledge Base by Anonymous user | June 10, 2021 01:00 AM
📖 Home Back
Perl scripts default OLE threading model is multi-threaded, which isn't supported by the automation interface. Fortunately there is a work around.
Any Perl script needs to include the line "Win32::OLE->Initialize( Win32::OLE::COINIT_APARTMENTTHREADED );" as the first call the program makes.
The working sample is:
Go: Home Back
Perl scripts default OLE threading model is multi-threaded, which isn't supported by the automation interface. Fortunately there is a work around.
Any Perl script needs to include the line "Win32::OLE->Initialize( Win32::OLE::COINIT_APARTMENTTHREADED );" as the first call the program makes.
The working sample is:
#!c:\perl\bin\perl.exe -wuse Win32::OLE;main:{ Win32::OLE->Initialize( Win32::OLE::COINIT_APARTMENTTHREADED ); my $scx = Win32::OLE->new( 'Serck.ScxV6Server' ); $scx->connect( 'MAIN', '', '' ); $scx->FindObject( 'test' ); print Win32::OLE->LastError();}
Go: Home Back
Author
Link copied. Please paste this link to share this article on your social media post.