描述:
我在IDL文件里定义:
typedef
[
uuid(EDEB1379-C3F4-4265-9A4E-7290D0FAD5F4),
helpstring("Operation Type"),
]
enum mathOPERATION
{
[helpstring("Add")] mathAdd = 0x0001,
[helpstring("Subtract")] mathSubtract = 0x0002,
[helpstring("Multiply")] mathMultiply = 0x0003,
[helpstring("Divide")] mathDivide = 0x0004
}mathOPERATION;
在接口处:
[helpstring("method Compute")]
HRESULT Compute([in] mathOPERATION enumOp,
[in] long IOp1,[in] long IOp2,
[out,retval] long* plResult);
为什么就出错了!
解决方案1:
不用这么麻烦:
在vc6下
typedef enmu mathOPERATION_
{
[helpstring("Add")] mathAdd = 0x0001,
[helpstring("Subtract")] mathSubtract = 0x0002,
[helpstring("Multiply")] mathMultiply = 0x0003,
[helpstring("Divide")] mathDivide = 0x0004
}mathOPERATION;
在vc7下:
[export]
enmu mathOPERATION_
{
[helpstring("Add")] mathAdd = 0x0001,
[helpstring("Subtract")] mathSubtract = 0x0002,
[helpstring("Multiply")] mathMultiply = 0x0003,
[helpstring("Divide")] mathDivide = 0x0004
}mathOPERATION;
就可以了!
去掉enum前的属性描述试试