Negima has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to convert visual basic scripting code to Perl, and I'm running into a wall. The below snippet creates a new object pointing to an existing process running within a DLL. I've tried looking at the process modules, but they only give me the filename.exe for the program running, not the processes contained within any given executed DLL.
Set oSysC = CreateObject ("NAMESPACE.object.objectProxy.1")
Suggestions for the Perl version? Thanks.

Replies are listed 'Best First'.
Re: Connecting to a Win32 process
by Corion (Patriarch) on Mar 08, 2007 at 16:20 UTC

    Depending on whether you want to create a new instance or connect to an existing instance, one of the two translations using Win32::OLE should work:

    my $appname = "NAMESPACE.object.objectProxy.1"; my $app; # Connect to the running instance $app = Win32::OLE->GetActiveObject($appname);

    or

    # Create a new instance my $app = Win32::OLE->new($appname);