MapInfo Pro Developers User Group

Expand all | Collapse all

Using the MapBasic function MIXmlDocumentLoad crashes MI Pro (v17)

  • 1.  Using the MapBasic function MIXmlDocumentLoad crashes MI Pro (v17)

    Posted 10-19-2018 14:01

    I'm trying to use the function MIXmlDocumentLoad but when my MapBasic program calls this function the whole of MI Pro (v17) crashes. The same code works fine in the 32 bit version of MI (v11.5).

    The code I am using is:

     

    Dim bParseError As SmallInt

    Dim hXMLDoc As MIXmlDocument

    Dim hXMLRoot As MIXmlNode

    Dim hXMLNode As MIXmlNode

     

    OnError Goto GetTitleError

     

    '-------------------------------------------------

    ' Create a document handle

    '-------------------------------------------------

    hXMLDoc = MIXmlDocumentCreate()

     

    If hXMLDoc Then

    '-------------------------------------------------

    ' Load the document into the document handle

    '-------------------------------------------------

    Dim iXMLLoad As SmallInt

    iXMLLoad = MIXmlDocumentLoad(hXMLDoc, "D:\LRCs\LERC\DataSelector\64bit\DataSelector.xml", bParseError, 0, 0)

     

    I'm using:

    Define MIXML_LIB_NAME "MapInfo.XmlUtil.dll"

    in the 64bit and:

    Define MIXML_LIB_NAME "GmlXlat.dll"

    in the 32bit.

     

    C



  • 2.  RE: Using the MapBasic function MIXmlDocumentLoad crashes MI Pro (v17)

    Posted 10-21-2018 07:03
    Have you tried compiling the code with a recent MapBasic compiler, like 16.0 or 17.0? I remember we made some changes to the def files for the HTML functions at some point. I don’t remember the exact version


  • 3.  RE: Using the MapBasic function MIXmlDocumentLoad crashes MI Pro (v17)

    Posted 10-22-2018 05:14

    Hi Peter

    I'd just discovered this myself when you replied. Yes, it was the DEFINE statements in the XMLTypes.def file. The variables are now IntPtr instead of Integer. I had added the DEFINE statements to my application's own .def file instead of including the XMLTypes.def file, so I've corrected it now and the application no longer crashes MI.

    Many thanks for your reply.

    Andy