i just want to give you a short summary of the problem i had and a fix / workaround for it, since it may help with other activex- and general protection faults issues:
when calling certain methods (my assumption is, that maybe pointers are the problem) of activex-objects, paradox crashes, usually with a general protection fault. in most cases, this happens right before the endmethod-statement is reached. that brought me to the assumption, that the problem might be the "de-referencing" of variables. paradox / windows can´t clear them, or tries to get access to certain spaces of the memory, which is denied by windows. the following code in the pusubutton-event of a button is a good example for that:
method pushButton(var eventInfo Event)
var
oXD, oXMLElement oleAuto
endVar
if NOT oXD.open("Msxml2.DOMDocument.6.0") then
msgStop("Error", "cant create object")
return
endIf
oXMLElement = oXD.createElement("someElement")
msgInfo("", oXMLElement.xml)
oXD.appendChild(oXMLElement)
endMethod
the first time you push the button, the messagebox is displayed, showing the created xml-element. if you now switch from runmode into editmode, run the form and push the button again, paradox crashes: the oleauto variable oXMLElement was still in memory. i spend a lot of time searching for a fix for this problem and i finally got a workaround: before the end of the method, let the oleauto-variable reference another object, the progress-bar e.g.:
if NOT oXMLElement.open("MSComctlLib.ProgCtrl.2") then
msgStop("Error", "cant create object")
return
endIf
at least this works for me, with paradox 11, tested on win xp and win 7. any comments to this welcome. :-)