By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,275 Members | 1,745 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,275 IT Pros & Developers. It's quick & easy.

COM, IDL, and enum

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.