DispatchWrapper gives error
-
I have a vc++6.0 dll(ATL COM), a method in the dll takes a Variant(of type VT_DISPATCH) parameter as input. I am using this dll in vb.Net by imptlb process. The problem is that I am unable to pass the VT_DISPATCH type to my method. I am trying to use DispatchWrapper class as per MSDN but it gives unsupported interface error. Can any one help me out, its a bit urgent. I face the same problem in c# too. A solution in c# or vb.Net will do for me :-)). IDL Method Signature ==================== Compress([in,out] VARIANT* DocumentObject, [out,retval] short* retVal); DocumentObject is of type VT_DISPATCH. vb.Net code snippet ====================
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Comp As New XMLCOMPRESSIONLib.JNIXMLCompressionClass() Dim XmlDoct As New Xml.XmlDocument() Dim XYZ As Short XmlDoct.Load("C:\DEXML\asdfa.xml") **XYZ = Comp.Compress(DispatchWrapper(XmlDoct))** MessageBox.Show(XmlDoct.InnerXml) End Sub
I get error "Interface not supported" when I call compress with dispatch wrapper tyepcast.