Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Win32::OLE -- translation from vbs to pl

by Anonymous Monk
on Aug 28, 2013 at 00:20 UTC ( #1051211=note: print w/ replies, xml ) Need Help??


in reply to Win32::OLE -- translation from vbs to pl

More info might be found in the event viewer

But, you should check registry for MGCPCBAutomationLicensing..., check to see that the assoiated .dll can be located, and all the prerequisites it has can be located, located and loaded

you can use depends.exe ....

or you simply might need to Win32::OLE->Initialize to a different model


Comment on Re: Win32::OLE -- translation from vbs to pl
Re^2: Win32::OLE -- translation from vbs to pl
by sundialsvc4 (Monsignor) on Aug 28, 2013 at 02:10 UTC
    you simply might need to Win32::OLE->Initialize to a different model ...

    In cursorily reading this quote, here I really wish that you were not “Anonymous” (or that PM had not logged you out at the wrong instant ...), because I really would like to know more-specifically just what you meant by this.   Intuitively, it seems like this is most likely to be the crux of the problem.   After all, if the VB program works (although I notice that the two are not exactly the same at the end...), reason says that the Perl “equivalent” should do so, too.   If the registry entry were bad, neither program would work...

    So, “for those of us in the Peanut Gallery,” could you please elaborate on this?   What are the choices here?   How do they affect the program’s behavior? ...

    (Let’s make this thread as one-stop-shopping useful as possible to the Gentle Readers three years hence...)

      In cursorily ...

      read the documentation Win32::OLE->Initialize

Re^2: Win32::OLE -- translation from vbs to pl
by whumann (Novice) on Aug 28, 2013 at 08:43 UTC

    I don't know the Event Viewer too well. I looked at some logs but couldn't find anything related. Probably looked in the wrong place (or didn't know what to look for). Additonal poiters where to look appreciated!

    The registry entries, as far as my weak knowledge goes, look o.k.. I also wouldn't exepect a problem here when the vbs works fine.

    Dependency Walker reports it can't find GPSVC.DLL and IESHIMS.DLL, but these dependencies are deep down in MGCPCBAUTOMATIONLICENSING.DLL -> ADVAPI32.DLL -> WINTRUST.DLL -> CRYPT32.DLL -> .... Not sure what to make of that.

    All three possible values for Win32::OLE->Initialize() don't make a diference.

    There's a thread here http://communities.mentor.com/mgcx/thread/6235 about someone with problems porting the same code form vb.net to C#. I'm not sure if his solution (adding a reference to the appropriate COM object in visual studio) has any perl equivalent.

    Any additional ideas available? Thanks, Wolfram
      You arent using Dependenc Walker the best way. DW has a "Profile" feature. You will have to pick perl.exe, give it command args, and run the perl process in DW. This way all GetProcAddress and LoadLibrary es will be loged. The "The specified module could not be found" message will appear in there probably or its Win32 error code equivelent (0x8******* codes are Native API/COM error codes, not GetLastError codes). What you were looking at in your post was STATIC analysis. You did put the Initialize() before any other Win32::OLE calls except the use right? Worst case, stepping Win32::OLE's XS code is the only way to figure out what happened and what exactly went wrong. I've done it before to Win32::OLE and found a bug in Win32::OLE that already was on OLE's RT page.

      Written on a smart phone so sorry for spelling mistakes.
      oh yeah, what bulk88 is saying, try using depends.exe like this   depends.exe /c /f:1 /pb /ot:temp.txt ...perl.exe foo.pl ...
        As I just reported in a separate reply, my code works with a 32bit strawberry perl. The messages I get from depends.exe, called as suggested above, for MGCPCBAutomationLicensing look fairly innocent:
        Loaded "MGCPCBAUTOMATIONLICENSING.DLL" at address 0x00550000 by thread + 7. Successfully hooked module. DllMain(0x00550000, DLL_PROCESS_ATTACH, 0x00000000) in "MGCPCBAUTOMATI +ONLICENSING.DLL" called by thread 7. DllMain(0x00550000, DLL_PROCESS_ATTACH, 0x00000000) in "MGCPCBAUTOMATI +ONLICENSING.DLL" returned 1 (0x1) by thread 7. DllMain(0x00550000, DLL_PROCESS_DETACH, 0x00000000) in "MGCPCBAUTOMATI +ONLICENSING.DLL" called by thread 7. DllMain(0x00550000, DLL_PROCESS_DETACH, 0x00000000) in "MGCPCBAUTOMATI +ONLICENSING.DLL" returned 1 (0x1) by thread 7. Unloaded "MGCPCBAUTOMATIONLICENSING.DLL" at address 0x00550000 by thre +ad 7.
        When I try the same with my default 64bit perl however, I get
        Failure starting the process. The request is not supported (50).
        And I get this even when I just use perl.exe without any args (no program to load).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1051211]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-07-12 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls