Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dot net class libraries and VFP ?
Message
De
19/07/2004 15:27:22
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00917812
Message ID:
00925900
Vues:
49
This message has been marked as a message which has helped to the initial question of the thread.
This toolkit is not part of VFP, it has nothing to do with the VFP product development or features. It is a toolkit that is an add-on written in C++ and VFP to allow some .NET Framework classes to be used directly from within VFP. I think you are missing the possible technical benefits of using it from within VFP, like in the System.Xml case. Rather than subclassing a .NET class and then creating a COM object wrapper requiring VS, you can simply run code like this directly in VFP and never have to open or use VS or anything .NET related other than having the .NET Framework installed (which is free)...


CLEAR
* Load .NET wrappers
PUBLIC NET as NETWrapper of HOME(7) + "NETClasses\NETBase.prg")
NET = newOBJECT("NETWrapper", HOME(7) + "NETClasses\NETBase.prg")
NET.Using("System")
NET.Using("System.Xml")
NET.Using("System.Xml.Schema")

*Make an XML file, so we can load it
SET SAFETY off
USE HOME(2) + "Northwind\Customers"
CURSORTOXML(ALIAS(), "myXMLFile.xml", 1, 512, 5, "1")

LOCAL XMLDoc as NETSystemXml_XmlDocument OF HOME(7) + "NETClasses\NETSystemXml.prg"
XMLDoc = NET.New("NETSystemXml_XmlDocument")

XMLDoc.load3("myXMLFile.xml")

ShowMe(XMLDoc.get_ChildNodes(), 0)

*Recursively displays each ChildNode
PROCEDURE ShowMe(XMLNodeList as Variant, depth as Integer)
LOCAL i as Integer
LOCAL XMLNode as NETSystemXml_XmlNode
XMLNode = NET.Declare("NETSystemXml_XmlNode")

FOR EACH item IN XMLNodeList
XMLNode.setobject(item)

strVal = XMLNode.get_value()
strVal = IIF (ISNULL(strVal), "", strVal)

? REPLICATE(" ", depth)
?? XMLNode.get_name() + " : " + strVal

ShowMe(XMLNode.get_ChildNodes(), depth + 1)
ENDFOR
ENDPROC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform