This project is read-only.
1
Vote

Shape Selection in PowerBuilder 12.5 Classic

description

Hi, Im having some problems with this PB12.5 code:
 
/*
ioo_maplayer - Shapefile
ole_mapwin - OLE control
*/
If ole_mapwin.Object.CursorMode = 3 Then
Long ll_rtc
Boolean Result
Double x1, y1, x2, y2, z1, z2, xm, ym
OleObject loo_extent, lobj
loo_extent = Create OleObject   
    lobj = Create OleObject

ll_rtc = loo_extent.ConnectToNewObject('MapWinGIS.Extents') 

xm = Double( xpos )
ym = Double( ypos )

ole_mapwin.Setredraw( True )
ole_mapwin.Object.PixelToProj( xm - 10, ym - 10, ref x1, ref y1 )
ole_mapwin.Object.PixelToProj( xm + 10, ym + 10, ref x2, ref y2 )
 
loo_extent.SetBounds( x1, y1, z1, x2, y2, z2 )
 
Result = ioo_maplayer[1].SelectShapes( loo_extent, 0, 1, ref lobj )
If Result = False Then
    Messagebox( "", String( ioo_maplayer[1].ErrorMsg( ioo_maplayer[1].LastErrorCode ) ) )
End If
End If
 
The problem is the SelectShapes function. The referenced object variable that is supposed to return an integer array of the selected shapes' indices is always NULL.
I hope there are some PB devs out there. This seems basic but I'm really stuck.
 
Thanks.

comments