473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Howto access a enumeration in a COM TypeLib

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.
Jul 19 '05 #1
2 3511
On 6/21/05, Alexander Eisenhuth <ne******@stacom-software.de> wrote:
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, then
import myserver
print myserver.constants. P_OK

0

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

- kv
Jul 19 '05 #2
Thanks, thats it.

Konstantin Veretennicov schrieb:
import myserver
print myserver.constants. P_OK

0

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

- kv

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jwsacksteder | last post by:
I am trying to extend Crystal Reports with Python. The documented way to do this is to create a COM automation server with a specific naming convention that CR will then present inside the UI as...
12
by: Vince C. | last post by:
Hi, I've created a web application with Visual Interdev and I've added Microsoft XML, version 4 in project's references. A META tag has been successfully added in global.asa: <!--METADATA...
1
by: Justin Wright | last post by:
I know that I can set up an enumeration as follows ( just typed in quick so may have syntax errors ): <xsd:simpleType name="colors"> <xsd:restriction base="xsd:string"> <xsd:enumeration...
1
by: RichGolebiowski | last post by:
I have a class library (clsTestLib) that was created in VB.Net that I would like to use in Access 2000. I created a typelib for the class using regasm.exe. I am able to refernce (add a reference)...
4
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. ...
2
by: Jayme Pechan | last post by:
Is there a simple way to return a COM enumeration interface from .NET? I am porting a C++ COM Object that has an enumeration interface containing the DISPID_NEWENUM and DISPID_VALUE properties and...
9
by: Daniel Watrous | last post by:
Hello, I am interested in using python to script access to some hardware for which there are existing drivers in the form of DLLs. The DLLs each have four exported functions and a host of COM...
1
by: JavaXMLDev | last post by:
Hi I'm new to XML schema work, but wondered how, if at all possible, can you specify a relationship between the values of an element's attributes. Essentially I want context sensitive...
2
by: nassegris | last post by:
Hello! I need to somehow extract the TypeLib ID from a COM-dll compiled using VB6. Is is possible or do I have to look it up in the registry somehow (ie by iterating over TypeLibIDs in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.