rajesh.d has asked for the wisdom of the Perl Monks concerning the following question:

I have written a script in perl to access COM server
Below is the script::
import Win32::OLE;
import Win32::OLE qw(EVENTS);
use Win32::OLE::Variant;
use win32::OLE;
use Win32::OLE qw(EVENTS);
#my $TM = Win32::OLE->new ('TestInterfaceCOM.COMServComponent');
my $TM = Win32::OLE->new ('COM Server name');
if( Win32::OLE->LastError() )
{ print "Error creating the .NET COM Server: ". Win32::OLE->LastError();
} #my $num;
#$TM ->Test();
#$TM ->HelloWorld("Hi hello");

Im getting the below error while running the script
or creating the .NET COM Server: Win32::OLE(0.1403) error 0x80004002: "No suc h interface supported"
Please help
  • Comment on How to write a client for accessing COM server

Replies are listed 'Best First'.
Re: How to write a client for accessing COM server
by Anonymous Monk on Jun 14, 2011 at 04:20 UTC
      i have registered the server on my system .Im assking whether the script written by me is proper

        ...whether the script written by me is proper

        It compiles.

        You could have determined that by typing "perl -c myscript" That's far fewer keystrokes and gets an immediate answer of equal quality, with less attitude.

        I'm assking

        Thanks for assking.


        Dave

        i have registered the server on my system .Im assking whether the script written by me is proper

        What makes it proper? Its valid perl, does that make it proper? It makes valid Win32::OLE calls, does that make it proper? It generates some OLE error -- does that matter?