I'm trying to convert a cluster to a .NET object. I know you can't do it directly, so I tried flattening the cluster to a string and creating a .NET object out of the flattened string. This is not working either. The flattened string will contain some unprintable characters and it appears that the returned string is truncated at the first unprintable character. Is there a workaround for this? Maybe if the string is converted to a byte array first?
There really isn't a way of doing this directly. What's the .NET object that you are trying to cast to? Are you trying to cast it to a struct? If so, just call the constructor for the struct and then populate the members via property nodes. Then you can pass the struct object to the method/property that you are trying to call.
I'm not trying to cast to a particulr .NET object. I just want to box it to use a .Net collection class - a Hashtable in this case. Turns out that converting the flattened string to a byte array worked. I guess you could use this technique for any .Net collection class - pretty powerful.