Howto access a enumeration in a COM TypeLib

  • Thread starter Alexander Eisenhuth
  • Start date
A

Alexander Eisenhuth

Hello alltogether,

I hope somebody can help me in that case. I bet I have overseen s.th..

I have a VC++ IDispatch Com-Server (ATL) and include for error handling
issues a enumeration in the IDL-File.

[...]
enum PROG_ERROR {
P_OK = 0,
P_ERR_01 = 1,
P_ERR_02 = 2,
...
}
typedef enum PROG_ERROR PROG_ERROR_T;

[...]

I can acess the COM object using :

obj = win32com.client.Dispatch("...")

and can Load the TypeLib:

lib = pythonwin.LoadTypeLib("...")

and see the enumeration in the OLE-Browser of Windows, but don't know
how to access the enum in Python.

Any help and hints are very welcome.

Regards
Alexander

PS.: I use the actual version of ActivePython 2.4.
 
K

Konstantin Veretennicov

Hello alltogether,

I hope somebody can help me in that case. I bet I have overseen s.th..

I have a VC++ IDispatch Com-Server (ATL) and include for error handling
issues a enumeration in the IDL-File.

[...]
enum PROG_ERROR {
P_OK = 0,
P_ERR_01 = 1,
P_ERR_02 = 2,
...
}
typedef enum PROG_ERROR PROG_ERROR_T;

[...]

I can acess the COM object using :

obj = win32com.client.Dispatch("...")

and can Load the TypeLib:

lib = pythonwin.LoadTypeLib("...")

and see the enumeration in the OLE-Browser of Windows, but don't know
how to access the enum in Python.

Any help and hints are very welcome.

Regards
Alexander

PS.: I use the actual version of ActivePython 2.4.

Use site-packages/win32com/client/makepy.py to produce myserver.py
from your typelib file, then0

Maybe you can access constants without makepy, I don't know.

- kv
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top