[python-win32] COM Server and
TypeLibraries.obj._oleobj_.GetTypeInfoCount() = 0?
timothy at torpedogames.com
Fri Aug 13 02:19:32 CEST 2004
Thanks much for your help. The patches worked, except..
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. Is it possible that there is something else
not fully implemented that's causing an error? In searching LabView's
webpage for help on this error I find a few cases of this error. But no
real answers except for how to register a .tlb. Which I've done...
Otherwise how would I be able to select my testcom or Pippo from the COM
dropdown list in Labview?!
I wonder if the problem has to do with something in the .idl file? I have
another VB app with ActiveX/COM interface to labview that works and I'll
be looking over it's idl file for differences... some include:
appobject keyword in the [ ] section above 'coclass Pippo'
hidden and nonextensible keywords in the [ ] section above 'interface
IPippo : IDispatch'
There are other custom( -- ) declarations at other points in the working
Is there a tool I can use to monitor API calls to see what is failing?
Actually I found APISpy32 at http://www.internals.com/utilities_main.htm
but I've not got around to figuring out which API calls I need to look for
and what files they are located in. I also don't have MSVC for Spy++(?).
Any advice on approaches to solving this problem or within what realm they
exist -- me, labview, idl/tlb, pythoncom is most welcome!
Timothy Toroni, AB9GC, Sgt. York, timothy at torpedogames.com
On Thu, 12 Aug 2004, Mark Hammond wrote:
> > I am working on making a python COM server work with Labview which
> > requires the type libraries for the IDispatch interface...
> > Granted... at
> > the moment I'm not even able to have Makepy run on my
> > objects. It blows
> > up as shown below.
> > ** I get a PyITypeInfo object back. So what is the deal.
> > What is not in
> > the Pippo COM server which causes this failure? I've
> > registered the type
> > libraries.. in fact below I've attached the .IDL file that
> > oleview dumps.
> > I'm rather stumped at this point. Any advice is much apprieached. I
> > realize that Python COM servers have come up in the past on this list
> > which use type libraries and I've gone over the messages...
> > but I must be
> > missing something.
> > It seems like the object is not associating the type library with the
> > application?
> You are correct - the typelib is not associated. Mainly as I just didn't
> think of it at the time :) I'll attach an update in private mail that at
> least makes things work for pippo.
More information about the Python-win32