Hi Charles,
if I modify Pgbar3d.inc and add in function CreatePGBar3D starting at about line 162 int x,y,w,h then Pgbar3d.o2bas works:
...
if DlgUnits then
RECT rc = {0, 0, 4, 8}
MapDialogRect (hParent, @rc)
float PixelX = rc.right/4
float pixelY = rc.bottom/8
int x = vLeft*PixelX
int y = vTop*PixelY)
int w = vWidth*PixelX
int h = vHeight*PixelY
'create control using dialog units
hBar = CreateWindowEx(wStyleEx, "PGBAR3D", null, wStyle,
'int(vLeft*PixelX), int(vTop*PixelY), int(vWidth*PixelX), int(vHeight*PixelY),
x,y,w,h,
hParent, id, GetWindowLongPtr(hParent, GWL_HINSTANCE), null)
if hBar = 0 then mbox "Error 1: CreateWindowEx PGBAR3D failed"
else
'create control using pixels
hBar = CreateWindowEx(wStyleEx, "PGBAR3D", null, wStyle,
vLeft, vTop, vWidth, vHeight,
hParent, id, GetWindowLongPtr(hParent, GWL_HINSTANCE), null)
if hBar = 0 then mbox "Error 2: CreateWindowEx PGBAR3D failed"
end if
if hBar and len(txt) then SetWindowText(hBar, txt)
function = hBar
end function
...
This is what I mean with stricter handling of arguments. Or is there another way with casting? E.g. int(vLeft*PixelX) does not work anymore.