Closed comintern closed 7 years ago
As far as I've been able to determine, TKIND_ALIAS
doesn't seem to be natively supported in VBA. The LONG_PTR
alias appears to be handled internally by VBE7.dll and exposed as a type keyword (and already handled in the COM collection). Disabling its resolution from the typelibs - this can be reopened if anyone happens to run across a library that has a TKIND_ALIAS
that's exposed to VBA.
It's not a library, but I think Access Forms/Reports use aliases for controls that have names with non-standard names in them. That is, myForm.some_control
and myForm.[some control]
are both references to the same control. IIRC, only one of them is declared WithEvents
@ThunderFrame - That actually looks more like the extensible interface for myForm
in the first case, and the evaluate member for the second. The referenced commit above breaks the hell out of the resolver though - these need to be handled internally in the COM collector.
stdole2.tlb
contains
typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB), public]
unsigned long OLE_COLOR;
and both VBA and VB6 accept
Dim a As OLE_COLOR
and although OLE_COLOR
cannot be located by searching w/ Object Browser in the IDE, the alias is still present as param/retval type on some method declarations.
Neither of these COM types appear in the VBA object browser, and there really isn't a direct analogue to them in the language. For example, in MSHTML, the union
tag__MIDL_IWinTypes_0009
is declared as:All of the following dim statements result in a compile error "User-defined type not defined":
This declaration...
Dim x As [__MIDL_IWinTypes_0009]
...gives a compile error "Automation type not supported in Visual Basic", but it isn't clear if it's due to the fact that it's a 'union' or due to the naming (__
is usually a reserved identifier).TKIND_ALIAS is a bit trickier, because it does appear that VBA recognizes them. These are currently treated as class Declarations in the COM collector, although that is not technically correct - they are treated like intrinsic types. In MIDL these appear as
typedef
declarations. A good example is in VBE7.dll:Basically this is letting callers know that (at least on this 32 bit version), anything declared as
LONG_PTR
should be treated as aLong
.I'm up in the air as to whether these need a special form declaration or something else, but down the road they do need to be handled similarly to intrinsic types when they're used as
asTypeDeclarations
.