Cannot use enumeration values from type libraries.
Hello newsgroup,
my question is about the MIDL-compiler. I want to import a type library
into my own library, but I can't use any of the imported enumeration values.
The base library looks like this:
[
uuid(6A7B3B27-AE89-4255-8BEF-8B937FDD788B),
version(1.0)
]
library TestBaseLibrary
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(E0AFC11A-EFB3-405c-9C18-47ABEF1E4292),
v1_enum
]
enum ETestEnum
{
TEST_IDENTIFIER = 0
};
}
and the importing library like this:
[
uuid(35D8801C-9E59-4388-BCBA-D9FA41A50572),
version(1.0)
]
library TestDerivedLibrary
{
importlib("TestBaseLibrary.tlb");
[
object,
uuid(BED6D356-8546-482d-8F11-516BDBF43B72),
pointer_default(unique)
]
interface ITestInterface
{
[id(1)]
HRESULT TestMethod
(
[in, defaultvalue(TEST_IDENTIFIER)] enum ETestEnum MyEnum
);
};
}
However, if I try to compile this I get "error MIDL2035 : constant
expression expected". What's the cause?
TIA,
Stuart
date: Wed, 24 May 2006 17:17:02 +0200
author: Stuart Redmann