12
12
13
13
namespace Rubberduck . Parsing . ComReflection
14
14
{
15
+ internal enum DispId
16
+ {
17
+ Collect = - 8 , //The method you are calling through Invoke is an accessor function.
18
+ Destructor = - 7 , //The C++ destructor function for the object.
19
+ Construtor = - 6 , //The C++ constructor function for the object.
20
+ Evaluate = - 5 , //This method is implicitly invoked when the ActiveX client encloses the arguments in square brackets.
21
+ NewEnum = - 4 , //It returns an enumerator object that supports IEnumVARIANT.
22
+ PropertyPut = - 3 , //The parameter that receives the value of an assignment in a PROPERTYPUT.
23
+ Unknown = - 1 , //The value returned by IDispatch::GetIDsOfNames to indicate that a member or parameter name was not found.
24
+ Value = 0 //The default member for the object.
25
+ }
26
+
15
27
[ DebuggerDisplay ( "{MemberDeclaration}" ) ]
16
28
public class ComMember : ComBase
17
29
{
@@ -20,6 +32,8 @@ public class ComMember : ComBase
20
32
public bool ReturnsWithEventsObject { get ; private set ; }
21
33
public bool IsDefault { get ; private set ; }
22
34
public bool IsEnumerator { get ; private set ; }
35
+ //This member is called on an interface when a bracketed expression is dereferenced.
36
+ public bool IsEvaluateFunction { get ; private set ; }
23
37
public ComParameter ReturnType { get ; private set ; }
24
38
public List < ComParameter > Parameters { get ; set ; }
25
39
@@ -30,8 +44,9 @@ public ComMember(ITypeInfo info, FUNCDESC funcDesc) : base(info, funcDesc)
30
44
IsHidden = flags . HasFlag ( FUNCFLAGS . FUNCFLAG_FHIDDEN ) ;
31
45
IsRestricted = flags . HasFlag ( FUNCFLAGS . FUNCFLAG_FRESTRICTED ) ;
32
46
ReturnsWithEventsObject = flags . HasFlag ( FUNCFLAGS . FUNCFLAG_FSOURCE ) ;
33
- IsDefault = Index == 0 ;
34
- IsEnumerator = Index == - 4 ;
47
+ IsDefault = Index == ( int ) DispId . Value ;
48
+ IsEnumerator = Index == ( int ) DispId . NewEnum ;
49
+ IsEvaluateFunction = Index == ( int ) DispId . Evaluate ;
35
50
SetDeclarationType ( funcDesc , info ) ;
36
51
}
37
52
0 commit comments