Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instantiating a VFP com object from an ASPX
Message
 
À
04/12/2002 13:08:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00729531
Message ID:
00729694
Vues:
41
I've got a lot of demos of this at: http://www.activevfp.com/avfpdemo2/default.aspx
The key is the TLBIMP.exe command included with the free .NET framework. I would go this route to begin with instead of VS.NET which just does the same thing under the covers. This is especially true if you want to do most of your dev in VFP. Here's the basics-
you simply run the included tlbimp
command on your Visual FoxPro mtdll like:
tlbimp avfpdemo2.dll /out:avfpdemo2_dotnetproxy.dll
Then call your Visual FoxPro mtdll from ASP.NET(.aspx), for example, with the following C# (entered using
NotePad or the Visual FoxPro editor):
<% @Page Language="C#" ASPCompat="true" %>
<% @Import Namespace="avfpdemo2_dotnetproxy" %>
<%
server x ;    //server is the VFP class
x = new server() ;
try
   {
   	Response.Write(x.demo());   //demo is the VFP method 
   }
catch(Exception ex)
   {
       	Response.Write("Caught .NET exception, source: " + ex.Source + " message: " + ex.Message);  
   }
%>
>Hi,
>
>How do I create a referance to a VFP com object from an ASPX.
>
>I have a lot of legacy VFP com objects that I would like to use in ASPX.
>
>Regards,
>Neil
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform