Microsoft Content Management Server - "bad variable type" when getting resource item from gallery

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > September 2004 > "bad variable type" when getting resource item from gallery





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author "bad variable type" when getting resource item from gallery
geronimo

2004-09-23, 9:18 am

Hi,

When I loop through a resource gallery and try to get the resources in it, I
get a strange error:

[COMException (0x80020008): Bad variable type.]

Microsoft.ContentManagement.Interop.Publishing.IRcwResources.get_Item(Object
index) +0
Microsoft.ContentManagement.Publishing.ResourceCollection.get_Item(Int32
index) +60

[CmsServerException: Bad variable type.]
Microsoft.ContentManagement.Publishing.ResourceCollection.get_Item(Int32
index) +90

the code looks like this;

[start snippet]
Dim rGallery As ResourceGallery
Dim mCol As ResourceCollection
Dim theResource As Resource
Dim i As Integer

'...get the resource gallery

If Not rGallery Is Nothing Then
mCol = rGallery.Resources
For i = 0 To mCol.Count - 1
theResource = mCol.Item(i) 'error!!
Next i
End If
[end snippet]

I get the error on the mCol.getItem(i) statement
Shouldn't this work like that? Or am I doing something wrong here?

Env: Win2k3, MCms2002sp1a

Geronimo

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com