I will try to be brief: we have code written in Visual Basic 6.0 that I am trying to compile on a 64-bit Windows 7. computer (It used to be compiled on an old XP computer.) Most of the code seems to compile correctly, however Certain code that has attributes, such as NewEnum, does not comply with the VB attribute. Here is an example:
The VB6 method is as follows:
Public Property Get NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
'this property allows you to enumerate
'this collection with the For...Each syntax
Set NewEnum = mCol.[_NewEnum]
End Property
This is the default enumerator created during use Class Builder Utility
.
However, attribute elements are not executed when compiling the code. Using the OLE View program, it shows that attributes are ignored.
The XP computer displays the following snippet:
[id(0xfffffffc), propget, hidden]
HRESULT NewEnum([out, retval] IUnknown** );
But the Windows 7 computer generates:
[id(0x68030000), propget]
HRESULT NewEnum([out, retval] IUnknown** );
Visual Basic XP (Service Pack 3), .
- VB6 .NET , . - , VB6 , ?