I need help to register latest MapWinGIS-only-v5.0.0.0-Win32 OCX.
The bellow code (PowerBuilder) works fine with MWGISv4.9.4.0-Win32 but NOT with latest MapWinGIS-only-v5.0.0.0-Win32!
Program crash on these lines
sf.ErrorMsg(shapeObjekt.LastErrorCode) >>>> can not catch the COM error
sf.Open(sfn, callBck)
sf.CreateNew(sfn, 1)
I did manage to register the MWGISv4.9.4.0-Win32 OCX successfully.
I did uninstall the MWGISv4.9.4.0-Win32
I did install latest MapWinGIS-only-v5.0.0.0-Win32 >>> successfully register new OCX !!!
for all above steps using your unregMapWinGIS.cmd and regMapWinGIS.cmd.
ConnectToNewObject is OK, but on OPEN, CreateNew, … program crash!
OLEObject callBck
OLEObject sf
sf = CREATE OLEObject
rc = sf.ConnectToNewObject("MapwinGIS.ShapeFile")
IF rc < 0 THEN
DESTROY sf
MessageBox("Connecting to COM Object Failed", &
"Error: " + String(rc))
return
END IF
sfn = "C:\LINES.shp"
result = sf.Open(sfn, callBck)
sf.Close
sf.DisconnectObject()
DESTROY sf
The biggest change in v5.0 is the upgrade from VS2013 to VS2015. More users have reported strange behavior in for example Access as well.
It looks like VS2015 is making more changes than we expected. Most likely it is more strict now.
ConnectToNewObject is not a method made by us. It is probably a specific PowerBuilder method.
I’m not familiar with PowerBuilder. But without a more detailed error message is it very difficult to debug.
Perhaps this link can help.
Does putting sf.Open(sfn) inside a try ... catch help?
Did you (@vzav or @jdema) found a solution with your PowerBuilder workflow?
Like @jerryfaust mentioned at the MW-development team we don’t have any experience with PowerBuilder.
Perhaps posting this question on the PowerBuilder forum might get more response about how to use COM-objects and what requirements a COM-object needs.