How to use enum and optional in IDL and ACTIVEX? 
Author Message
 How to use enum and optional in IDL and ACTIVEX?

Hi

I have the following IDL

typedef [v1_enum] enum{TBAlignRight = 0,TBAlignLeft,TBAlignCenter}
TBAlignment;

[id(1) ] HRESULT AddColumn([in,optional]VARIANT
Index,[in,optional]TBAlignment Alignment)

my question is how do i test if Alignment is empty(i know how to do it with
VARIANT)

Thanks in advance

Tomer



Fri, 24 Sep 2004 07:15:14 GMT  
 How to use enum and optional in IDL and ACTIVEX?

Quote:

> Hi

> I have the following IDL

> typedef [v1_enum] enum{TBAlignRight = 0,TBAlignLeft,TBAlignCenter}
> TBAlignment;

> [id(1) ] HRESULT AddColumn([in,optional]VARIANT
> Index,[in,optional]TBAlignment Alignment)

> my question is how do i test if Alignment is empty(i know how to do it with
> VARIANT)

> Thanks in advance

> Tomer

The [optional] attribute is valid only if the parameter is of type
VARIANT or VARIANT *.


Fri, 24 Sep 2004 11:53:38 GMT  
 How to use enum and optional in IDL and ACTIVEX?

Quote:

> The [optional] attribute is valid only if the parameter is of type
> VARIANT or VARIANT *.

Officially, yes, but VB non-Variant optional parameters are equivalent
to IDL non-VARIANT optional parameters.


Fri, 24 Sep 2004 22:48:25 GMT  
 How to use enum and optional in IDL and ACTIVEX?

Quote:

> I have the following IDL

> typedef [v1_enum] enum{TBAlignRight = 0,TBAlignLeft,TBAlignCenter}
> TBAlignment;

> [id(1) ] HRESULT AddColumn([in,optional]VARIANT
> Index,[in,optional]TBAlignment Alignment)

> my question is how do i test if Alignment is empty(i know how to do it with
> VARIANT)

You don't.  If you need to know whether it was specified (rather than
picking up the default value, you have to use a VARIANT, which can be
tested for Missing.  Otherwise, just provide a reasonable default in
the IDL (or accept the default default, if that's appropriate), and
you may proceed as if the parameter were specified.


Fri, 24 Sep 2004 22:50:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using enum types in IDL interface methods?

2. Optional IDL Parameters and C++

3. Using VB ActiveX DLL Class in IDL

4. Optional keyword in IDL

5. IDL optional parameters

6. Using enum/ v1_enum in ATL Activex Control in VS .Net

7. IDL & ENUM

8. ATL7: enum's in IDL?

9. Attributed C++: How can I have a custom enum in idl

10. typedef enum in IDL for BSTR const

11. typedef/enum visibility in .idl

12. Question About Enum's In IDL

 

 
Powered by phpBB® Forum Software