VFP and .NET Interop
Calling a C# function from VFP
Gravatar is a globally recognized avatar based on your email address. Calling a C# function from VFP
  Alejandro A Sosa
  All
  Aug 28, 2015 @ 06:37am
Hello,

1. We have a VFP application that needs to create an XML file in the same format as a given example.
2. In http://xmlgrid.net/xml2xsd.html we can create an xsd file from the example.
3. I want to create a C# routine to create the xml using the classes in System.Xml.Linq namespace
4. I want to call this routine from VFP passing in the data and xsd file and receiving the xml as a string value.

How can I make the call from VFP?
How do I pass the data to the routine in a format it can use?
How do I go about receiving the Xml as a string value?

Thank you very much,

Alex

Gravatar is a globally recognized avatar based on your email address. Re: Calling a C# function from VFP
  Rick Strahl
  Alejandro A Sosa
  Aug 28, 2015 @ 10:57am

Create a .NET class library and create an assembly. Then use wwDotnetBridge to call it...

+++ Rick ---



Hello,

1. We have a VFP application that needs to create an XML file in the same format as a given example.
2. In http://xmlgrid.net/xml2xsd.html we can create an xsd file from the example.
3. I want to create a C# routine to create the xml using the classes in System.Xml.Linq namespace
4. I want to call this routine from VFP passing in the data and xsd file and receiving the xml as a string value.

How can I make the call from VFP?
How do I pass the data to the routine in a format it can use?
How do I go about receiving the Xml as a string value?

Thank you very much,

Alex


Gravatar is a globally recognized avatar based on your email address. Re: Calling a C# function from VFP
  Alejandro A Sosa
  Rick Strahl
  Aug 31, 2015 @ 03:22am
Thank you Rick. In what format should I pass the cursor from VFP to the assembly?

Alex

Create a .NET class library and create an assembly. Then use wwDotnetBridge to call it...

+++ Rick ---



Hello,

1. We have a VFP application that needs to create an XML file in the same format as a given example.
2. In http://xmlgrid.net/xml2xsd.html we can create an xsd file from the example.
3. I want to create a C# routine to create the xml using the classes in System.Xml.Linq namespace
4. I want to call this routine from VFP passing in the data and xsd file and receiving the xml as a string value.

How can I make the call from VFP?
How do I pass the data to the routine in a format it can use?
How do I go about receiving the Xml as a string value?

Thank you very much,

Alex



Gravatar is a globally recognized avatar based on your email address. Re: Calling a C# function from VFP
  Rick Strahl
  Alejandro A Sosa
  Aug 31, 2015 @ 06:57am

Probably easiest to pass the data as a collection. Web Connection includes CursorToCollection().

Alternately you can serialize to JSON or XML, but you will need to create matching classes on the .NET to deserialize those objects.

+++ Rick ---


Thank you Rick. In what format should I pass the cursor from VFP to the assembly?

Alex

Create a .NET class library and create an assembly. Then use wwDotnetBridge to call it...

+++ Rick ---



Hello,

1. We have a VFP application that needs to create an XML file in the same format as a given example.
2. In http://xmlgrid.net/xml2xsd.html we can create an xsd file from the example.
3. I want to create a C# routine to create the xml using the classes in System.Xml.Linq namespace
4. I want to call this routine from VFP passing in the data and xsd file and receiving the xml as a string value.

How can I make the call from VFP?
How do I pass the data to the routine in a format it can use?
How do I go about receiving the Xml as a string value?

Thank you very much,

Alex






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

© 1996-2024