Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and ASP.NET Interop
Message
 
To
25/03/2002 03:05:46
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00635207
Message ID:
00643082
Views:
19
Claudio,
Here's some simple C# and VB code for calling VFP mtdlls from ASP.NET (the important part is the error handling):
C#
<% @Page Language="C#" ASPCompat="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);  
   }

%>
VB.NET
<%@ Page Language="VB" ASPCompat="true" %>
<% @Import Namespace="avfpdemou_dotnetproxy" %>
<script runat=server>
Dim x as server
Public Sub Page_Load()
   x = new server()
   Try
       ' main function 
      Response.Write(x.demo())
   Catch ex As Exception
       ' Catch and handle exception
      Response.Write("Caught .NET exception, source: " + ex.Source + _
                       " message: " + ex.Message)   
   End Try
    

End Sub  
</script>
Also, Rick Strahl has a new white paper on the subject:
http://www.west-wind.com/presentations/VfpDotNetInterop/vfpDotNetInterop.htm

>Well, not that clear for me yet, but I´ll try to make some tests to discover how it must be implemented.
>
>Thanks, Claude.
>
>
>
>>Claudio,
>>It just allows you to step thru VFP source code in a VFP .exe which you can't do with a VFP mtdll by itself - this is useful in debugging. If you SET STEP ON in a VFP MTDLL, nothing will happen, but, if "file-based" mode you'll be able to do this...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform