Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dot net class libraries and VFP ?
Message
From
19/07/2004 15:27:22
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00917812
Message ID:
00925900
Views:
47
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform