[python-win32] COM Server and TypeLibraries.obj._oleobj_.GetTypeInfoCount() = 0?

Mark Hammond mhammond at skippinet.com.au
Fri Aug 13 05:41:47 CEST 2004


> My current situation is that I'm able to get the makepy
> utility to run and
> generate the .py files in the gencache directory -- I'm still however
> unable to get the COM server to work under labview.  The problem I'm
> having is that upon opening the device for usage (I suppose a
> CreateObject
> equiviliant) LabView returns the following error:
>
>
> -=-=-=-
> Error -2147221164 occurred at Automation Open
>
> This error code is undefined. No one has provided a
> description for this
> code, or you might have wired a number that is not an error
> code to the
> error code input.
> -=-=-=-
>
> It appears that the above error code is REGDB_E_CLASSNOTREG =
> 0x80040154.
> (From net references)
>
> So I'm not sure why LabView thinks the class is not
> registered... I get
> this error for both my testcom server (compiled /w py2exe)
> and Pippo (.py
> only) from within labview.

That specific error code will be returned by the Pythoncom framework (and
py2exe) if creating an instance of the class failed.  You should be able to
write a trivial VBScript script that uses CreateObject() to instantiate your
object, and that may give some clues.  If you run it from 'cscript.exe', you
may even see error messages printed to the console.

Are you sure you need to use py2exe?  It may be possible that labview will
still pick it up when running from source - a .dll is still named in the
registry as exposing the object, and I see no reason it would work under
py2exe, but *not* from source.

If you can get it running from source, just register it with "--debug".  It
may work - in which case we need to track down a py2exe specific issue.  If
it fails, you should see an exception in the Pythonwin trace collector.

Mark



More information about the Python-win32 mailing list