MikeD
Thu Jun 03 13:15:14 CDT 2004
"Benoit" <nospam@nospam.com> wrote in message
news:cjjub0h0ssrra9aa9ksrc7tc0gb3u0h6nq@4ax.com...
> Here's my code as showed in Notepad :
>
> VERSION 1.0 CLASS
> BEGIN
> MultiUse = -1 'True
> Persistable = 0 'NotPersistable
> DataBindingBehavior = 0 'vbNone
> DataSourceBehavior = 0 'vbNone
> MTSTransactionMode = 0 'NotAnMTSObject
> END
> Attribute VB_Name = "Collection1"
> Attribute VB_GlobalNameSpace = False
> Attribute VB_Creatable = True
> Attribute VB_PredeclaredId = False
> Attribute VB_Exposed = True
>
> Option Explicit
>
> Private m_objSPGM As COMSVCSLib.SharedPropertyGroupManager
>
> Public Function NewEnum() As IUnknown
> Attribute NewEnum.VB_UserMemId = -4
> Set NewEnum = m_objSPGM.[_NewEnum]
> End Function
>
> Private Sub Class_Initialize()
> Set m_objSPGM = New COMSVCSLib.SharedPropertyGroupManager
> End Sub
>
> Private Sub Class_Terminate()
> Set m_objSPGM = Nothing
> End Sub
>
> The error message is :
> Function or interface marked as restricted, or the function uses an
> Automation type not supported in Visual Basic.
>
> The definition of COM+ SharedPropertyGroupManager interface :
>
http://msdn.microsoft.com/library/en-us/cossdk/htm/isharedpropertygroupmanager_0gc2.asp
>
> I also foud that website:
>
http://www.mvps.org/vbvision/Super_Collections.htm
>
I don't get at all what you're trying to do now. If you want the
SharedPropertyGroupManager object exposed, then just create a public
property for it.
Public Property Get SPGM() As COMSVCSLib.SharedPropertyGroupManager
Set SPGM = m_objSPGM
End Property
Also, did you see this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/htm/isharedpropertygroupmanager_24rx.asp
which states "This property is restricted in Microsoft Visual Basic and
cannot be used.". IOW, you cannot use _NewEnum in your own code. It looks
like you need to expose SharedPropertyGroupManager as above and use a
For..Each on that.
Mike