473,473 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

COM, IDL, and enum

How do I access the values of the enum "ERLockStatus" specified in the
(abreviated IDL) file below?

This code works fine and lets me call the methods of the user
interface.
import win32com.client
ui = win32com.client.Dispatch('ERFile.User')
ui.someMethod()
Here is the (abreviated) IDL file:
// This file will be processed by the MIDL tool to
// produce the type library (ERFile.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";

[
uuid(bf79b6c5-47be-11d2-bacd-006008060a3a),
version(1.0),
helpstring("ERFile 1.0 Type Library")
]
library ERFile
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");

[
object,
uuid(bf79b6c7-47be-11d2-bacd-006008060a3a),
dual,
helpstring("IERecord Interface"),
pointer_default(unique),
nonextensible,
hidden
]
interface IUser : IDispatch { code deleted here };
[helpstring("ER Lock Status")]
enum ERLockStatus {
ls_unlocked, ls_by_caller, ls_by_another, ls_not_locked
};

more code deleted here

};
Thanks much in advance for your help.

Olaf
Jul 18 '05 #1
1 2186
Olaf Meding wrote:
How do I access the values of the enum "ERLockStatus" specified in the
(abreviated IDL) file below?


You must ensure that makepy has been run for your object - this
generally just means calling gencache.EnsureDispatch() to create your
object. Once the makepy'd file for the IDL has been loaded, the
constants will be available as "win32com.client.constants.constant_name"

Mark
Jul 18 '05 #2

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

Similar topics

20
by: Glenn Venzke | last post by:
I'm writing a class with a method that will accept 1 of 3 items listed in an enum. Is it possible to pass the item name without the enum name in your calling statement? EXAMPLE: public enum...
21
by: Andreas Huber | last post by:
Hi there Spending half an hour searching through the archive I haven't found a rationale for the following behavior. using System; // note the missing Flags attribute enum Color {
31
by: Michael C | last post by:
If a class inherits from another class, say Form inherits from control, then I can assign the Form to a variable of type Control without needing an explicit conversion, eg Form1 f = new Form1();...
18
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! I have created an enum list like this: enum myEnum : int { This = 2, That, NewVal = 10, LastItm
2
by: Dennis | last post by:
I have an enum as follows: Public Enum myData FirstData = 6 SecondData = 7 end enum Is there anyway that I can return the Enum names by their value, i.e., I want to input 6 into a function...
13
by: Don | last post by:
How do I get an Enum's type using only the Enum name? e.g. Dim enumType as System.Type Dim enumName as String = "MyEnum" enumType = ???(enumName)
10
by: Randy | last post by:
Hi, Can anyone point me to a complete, compilable example of Besser's ENUM++ mechanism? I downloaded it from CUJ and gave it a try but got errors just trying to compile the header enum.h. ...
1
by: Randy | last post by:
Hi, I downloaded and tried the ENUM++ code from CUJ http://www.cuj.com/documents/s=8470/cujboost0306besser/ but can't even get it to compile (see following). I have also downloaded and...
2
by: Randy | last post by:
Hi, I downloaded and tried the ENUM++ code from CUJ http://www.cuj.com/documents/s=8470/cujboost0306besser/ but can't even get it to compile (see following). I have also downloaded and...
34
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
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
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...
1
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.