Viv,
You should probably always use GetObjectContext in VFP to gain access to the ASP intrinsic obects from ASP.NET. You won't need to pass those objects as parameters using this method - they'll automatically be passed.
For example, in VFP do:
oMTS = CreateObject("MTxAS.AppServer.1")
oContext = oMTS.GetObjectContext()
oAVFP.Load(oContext.Item("Request"),oContext.Item("Response"),oContext.Item("Session"))
oRequest.Load(oContext.Item("Request"))
oResponse.Load(oContext.Item("Response"))
oSession.Load(oContext.Item("Session"))
and from ASP.NET/C#:
<% @Page Language="C#" ASPCompat="true" Debug="true" %>
<% @Import Namespace="avfpdemou_dotnetproxy" %>
<%
server x ;
x = new server() ;
try
{
Response.Write(x.demo());
}
catch(Exception ex)
{
Response.Write("Caught .NET exception, source: " + ex.Source + " message: " + ex.Message);
}
%>
>Hi,
>
>Using VFP6 and Release version of the .NET framework I had no problems passing the ASP.NET Response object as a parameter to a method in a VFP DLL.
>
>I'm now using SP1 on the framework and VFP7 (no SP). Passing in the Response object (or, I think) any .NET object now produces an 'InvalidCastException' error. Compiling in VFP6 also now produces a (different) error - 'COMException (data type mismatch)'. The method being called does nothing. Passing a VFP object as a parameter works fine.
>
>Is this something that changed with the .NET SP - or have I forgotten about something in my setup ?
>
>TIA,
>Viv