Partilhar via


VFPXMLProgID Property

References a COM component that can be used to override functionality of the internal XML functions.

_VFP.VFPXMLProgID [=cValue]

Parameters

  • cValue
    Specifies the ProgID of the COM component class whose functions override the functionality of internal Visual FoxPro XML functions (CURSORTOXML( ), XMLTOCURSOR( ), or XMLUPDATEGRAM( )). Setting cValue to the empty string ("") resets to the internal XML functions.

Remarks

The class must implement the IVFPXML interface from Visual FoxPro. The COM component can be created in Visual FoxPro, Visual C/C++, Visual Basic or any developer tool that creates COM components with the ability to implement interfaces. The default value is "", which means to use the internal implementations of these functions.

To provide methods to overwrite, run the Object Browser and, from the Microsoft Visual FoxPro 7.0 type library, drag the IVFPXML interface to a program.

Example

In a project, named MyXMLproj, create a class containing the following:

DEFINE CLASS MyXMLclass AS session OLEPUBLIC
   
   IMPLEMENTS IVFPXML IN "VisualFoxPro.Application.7"
   
   PROCEDURE IVFPXML_CursorToXML(bstrAlias AS STRING, ;
      nOutputFormat AS Number, nFlags AS Number, ;
      nRecords AS Number, bstrOutputFile AS STRING, ;
      bstrSchema AS STRING, bstrSchemaLocation AS STRING, ;
      bstrNameSpace AS STRING, pVFP AS VARIANT) AS VARIANT ;
      HELPSTRING "Converts from a Cursor to XML"
       * add user code here
   ENDPROC

   PROCEDURE IVFPXML_XMLToCursor(pvarXMLSource AS VARIANT, ;
      bstrCursorName AS STRING, nFlags AS Number, pVFP AS VARIANT) ;
      AS Number HELPSTRING "Converts from XML to a Cursor"
       * add user code here
   ENDPROC
   
   PROCEDURE IVFPXML_XMLUpdateGram(nFlags AS Number, ;
      bstrCursorList AS STRING, pVFP AS VARIANT) AS VARIANT;
      HELPSTRING "Generates an XML UpdateGram"
       * add user code here
   ENDPROC
ENDDEFINE
   

Add your custom XML function handler code to the three methods, and set the VFPXMLProgID property to your ProgID.

See Also

_VFP System Variable | Viewing Type Library Information | XML Functions | Visual FoxPro and XML | CURSORTOXML( ) | XMLTOCURSOR( ) | XMLUPDATEGRAM( )