|Thanks for the answer, but in order to cast, you need to have a type to cast to. In this case, the variable being passed (as an object), is actually a vb6 form, and to get the type means that I need a reference to the vb6 dll, and the form needs to be an exported type.
If I was using VB.net (and I have tried this), I can just reference properties of the object without casting, or creating a reference, presumably using late binding to query the object at runtime "under the bonnet" - this is all taken care of for the VB developer.
My question is: how can I do the same thing in c#?
To clarify the sample code:
dim obj as MREPlugin32.MREPlugin<br />
set obj = new MREPlugin32.MREPlugin<br />
VB.net code (this works):
public Sub Init(obj as Object)<br />
dim location as string = obj.Location<br />
End Sub<br />
So how can I do this?
public Void Init(object obj)<br />
string location = obj.Location;