PowerBuilder OLEobject to MapWinGis OCX crash!

#1

Hi there!

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)  
  1. I did manage to register the MWGISv4.9.4.0-Win32 OCX successfully.
  2. I did uninstall the MWGISv4.9.4.0-Win32
  3. 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

Thanks and regards, Vojko

0 Likes

#2

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?

0 Likes

#3

Yes, “ConnectToNewObject” is a PowerBuilder method and works perfectly with all MapWinGis OCX under 5.0 version.

Changing my code with try-catch statement as you had proposed brings no success:

TRY 
	result = sf.Open(sfn, callBck)
CATCH (OLERuntimeError err)
	  MessageBox("Error:  " + string(err.Number), 
             err.GetMessage() +'~r~n' + err.Description)
END TRY

The program still crashes at the line with sf.Open(sfn, callBck) and the error message is:

Error: 32
"Name not found calling external object function open at line … "

By installing the old MapWinGIS-only-v4.9.6.1-Win32 back again the same PowerBuilder though, the same code performs flawlessly.

Thank you for any suggestion,
Regards Vojko

0 Likes

#4

Same problem at our house: PowerBuilder 11.5 works well with mapwingis 4.9 but not with latest ver 5.0.
So, the problem might be in mapwingis!?

Thanks for any advise.

JDema

0 Likes

#6

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.

0 Likes