Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Passing multiple objects to property pages
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 21st April 12:40
scott campbell <>
External User
 
Posts: 1
Default Passing multiple objects to property pages



Hello all,

I'd like to pass multiple MMCListItems to a single property page, so that a


param. Or... you can use an array of Object.

So, when I call CreatePropertySheet, I pass in an Object array of
MMCListItem:

Dim oMultipleObject() As Object
ReDim oMultipleObject(iCount)

For i = 1 To iCount
Set oMultipleObject(i) = Selection.ListItems(i)
Next i

CurrentView.PropertySheetProvider.CreatePropertySh eet "Configuration",
siPropertySheet, oMultipleObject, False, False

When attempting to .AddPropertyPages, I get a generic error: "The server
threw an exception". I've tried to pass in an array of MMCListItem, but I
get the same message. Passing in individual ScopeItems or ListItems,
everything works great.

Anyone have an example of passing multiple ListItems to a property page?

Thanks!
Scott
  Reply With Quote


  sponsored links


2 30th April 23:03
barbara b.
External User
 
Posts: 1
Default Passing multiple objects to property pages



Hi Scott,

If you turn oMultipleObject into an array, I have a feeling it won't respond
properly to the normal COM stuff like IQueryInterface. That would explain
why you are getting errors.

Try creating oMultipleObjectList as a Collection. Then add the ListItems to
the collection. If I recall correctly VB's Collection object supports the
COM interfaces. If that doesn't work, declare a VB class that does basic
object list handling, then use that to pass the list of ListItems.

I pass a whole mess of objects to my property pages all the time. I've
created my own Selection class to pass a containing object with references
to all of the objects I need. That works fine. Just make sure to release
the references and selection object on PropertyPage_Terminate.

Barbara B.
  Reply With Quote
3 20th May 19:41
scott campbell <>
External User
 
Posts: 1
Default Passing multiple objects to property pages


Hi Barbara, thanks for your message! I've tried both approaches, both
passing a Collection and an object of my own class oObject containing an
array of ListItems. In both cases I receive a message "Invalid Argument"
when I try creating the property sheet. Should I be "cast"ing the object in
some way before passing it to the function? It seems to be expecting
Object().

Scott

___________________________
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666