WinBatch® Technical Support Forum

Archived Boards => COM Automation and dotNet => Topic started by: stevengraff on May 29, 2014, 06:47:52 AM

Title: OLE Initiate Failed - 1129
Post by: stevengraff on May 29, 2014, 06:47:52 AM
I get this error on one machine when I try to use

GMUI   = ObjectCreate("gmw.ui")

What should be my troubleshooting strategy?
(It works fine on all other machines)
Title: Re: OLE Initiate Failed - 1129
Post by: td on May 29, 2014, 07:16:56 AM
First step would be to make sure the COM Automation object represented by the progid "gmw.ui" is registered on the system.  If you have the WIL Type Viewer available on the problematic machine, use it to see if the progid shows up on the progid tab.  If not, you would need to do a registry search with regedit or a WIL script.  If the progid is present, you would also need to make sure that the DLL or exe for the object is also present and in the location indicated in the registry.  The location can be found in the InprocServer32 key under the classid key for the object.  The classid is the braces enclosed, dash delimited hex number found in the CLSID key under the "gmw.ui" progid key in the registry.
Title: Re: OLE Initiate Failed - 1129
Post by: stevengraff on May 29, 2014, 07:22:17 AM
Quote from: td on May 29, 2014, 07:16:56 AM
First step would be to make sure the COM Automation object represented by the progid "gmw.ui" is registered on the system.  If you have the WIL Type Viewer available on the problematic machine, use it to see if the progid shows up on the progid tab.
It shows up, but I get "unable to find a type library" and then I click "Yes" and get "object not found"
Title: Re: OLE Initiate Failed - 1129
Post by: td on May 29, 2014, 07:33:49 AM
Most likely cause is the DLL or exe that implements the object has gone missing or is in the wrong location.
Title: Re: OLE Initiate Failed - 1129
Post by: stevengraff on May 29, 2014, 07:34:38 AM
Quote from: td on May 29, 2014, 07:16:56 AMIf the progid is present, you would also need to make sure that the DLL or exe for the object is also present and in the location indicated in the registry.  The location can be found in the InprocServer32 key under the classid key for the object.

This part paid off!

The location was under LocalServer32, and there was a residual entry in the registry from a previous version of the product. I deleted all the "legacy" entries, and now it works OK.

Thank you.
Title: Re: OLE Initiate Failed - 1129
Post by: stevengraff on May 29, 2014, 07:51:28 AM
Actually... what would be the next step?

I'm getting an 1129 with a different program on a different machine, but it passes all the checks you gave me above. Except in this case, I can open it in the WIL Type Viewer.
Title: Re: OLE Initiate Failed - 1129
Post by: td on May 29, 2014, 08:15:27 AM
By different program do you mean a different COM Automation object or a different script or both?  When you access the object with the Type Viewer, does the viewer find a type library or does it ask to instantiate the object?  Is there a possibility that it is a permissions issue?  Do other COM Automation objects instantiate without issue on the system?

The brute force solution may be to simply (or not so simply) reinstall or re-register the COM Automation object.
Title: Re: OLE Initiate Failed - 1129
Post by: stevengraff on May 29, 2014, 12:48:34 PM
<< By different program do you mean a different COM Automation object or a different script or both? >>
both; though the script is nearly identical, just a couple of lines, just trying to create the object.

<< When you access the object with the Type Viewer, does the viewer find a type library or does it ask to instantiate the object? >>
I double-click it and it pops right open, and shows all it's methods, classes, library, etc.... no prompt.

<< Is there a possibility that it is a permissions issue?  Do other COM Automation objects instantiate without issue on the system? >>
On this particular computer, I have no problem opening the gmw.ui thing I brought up in my OP.

<<The brute force solution may be to simply (or not so simply) reinstall or re-register the COM Automation object.>>
Shouldn't be too difficult. The publisher says it all gets put in during installation of their software, so it should be a simple uninstall/reinstall, no?
Or, to "re-register the COM Automation object," I'd just do a regsvr32 followed by the dll path and file?
Title: Re: OLE Initiate Failed - 1129
Post by: stevengraff on May 29, 2014, 01:38:20 PM
Well... uninstall/reinstall (including complete manual deletion of the product's directories)... worked!

Thanks again for your help.
Title: Re: OLE Initiate Failed - 1129
Post by: td on May 29, 2014, 01:42:43 PM
The Type Viewer behavior indicates that the the object has a type library and that it is properly registered and in the correct location.  The type library can be either a separate file or contained within the object's DLL or exe implementation file.   If you are curious, the registered type library can be found by using it's typeLib GUID  which can be found as the TypeLib key under the object's CLSID key. There is a section in the registry devoted to type libraries and you can search for the typelib GUID in that area. If you poke around under that particular typelib key, you will eventually find the path to the type library.  You could see how it compares to the objects progid location.

Otherwise, sometimes we get lucky and the easiest solution actually works.
Title: Re: OLE Initiate Failed - 1129
Post by: stevengraff on May 29, 2014, 01:46:18 PM
Quote from: td on May 29, 2014, 01:42:43 PM
Otherwise, sometimes we get lucky and the easiest solution actually works.
I suppose I'm batting 500... the first issue took a little work to track down; the second solution, uninstall/reinstall, was pretty easy as it turns out. :)