Hi all,
I am migrating an ASP application to Asp.net and have run into a problem with an object parameter. Interestingly enough the old ASP application passes the Response object to a custom VB 6.0 class and then calls the Response.Write method to output some dynamic content inside the COM dll. Is it possible to keep that methodology in the new ASP.NET application - I tried to pass the Response object (HttpContext.Current.Response) to the COM class as-is without any attributes for marshalling etc. and my website currently errors out when the COM class executes the Response.Write method.
The error that I am getting is: Object Required, when i debugged the COM dll the variable that is assigned to the Response object is not showing as empty but the Watch window was displaying it as having no children.The variable in the COM dll that is assigned to the Response object parameter coming from VB.NET is of type Variant.
To make it clearer here is some sample code:
ASP.NET
Dim obj as Object = CreateObject("progIDofVB6.0class") ' Late Binding (tried early binding as well but got the same error)
obj.Output = HttpContext.Response
obj.PerformSomething
.....
VB 6.0 class
Public Property Set Output(ByVal obj As Variant)
mvarClientScripter = obj
End Property
Sub PerformSometing
....
Output.Write <string> ' Output here should be the Response object that was assigned above
....
End Sub
Any input is appreciated!
Thanks