Hi Everyone,
I have a calendar control which was working fine in 32bit (Calendar 32Bit.JPG), but after compiling in 64bit the calendar control appearing outside the application window as per attached (Calendar 64Bit.JPG), Im using PB 12.6 B4138. The behavior should be same as the 32bit application.
Below is the code function executed when button is clicked beside the text box (ROS Date)
POINT structure is in longlong as per changed in my previous problem which was fixed.
-------------------------------------------------------
long ll_i, ll_X, ll_Y, ll_DWx, ll_Height, ll_Split
string ls_s
POINT lPoint
Environment Env
GetEnvironment(Env)
ls_s = iDW.Describe(is_column + ".X")
ll_i = Pos(ls_s, "~t")
IF ll_i > 0 THEN ls_s = Mid(ls_s, ll_i + 1, Len(ls_s) - (ll_i + 1))
ll_X = UnitsToPixels(Long(iDW.Describe("Evaluate('" + ls_s + "', " + String(il_row) + ")")), XUnitsToPixels!)
ls_s = iDW.Describe(is_column + ".Y")
ll_i = Pos(ls_s, "~t")
IF ll_i > 0 THEN ls_s = Mid(ls_s, ll_i + 1, Len(ls_s) - (ll_i + 1))
ll_Y = UnitsToPixels(Long(iDW.Describe("Evaluate('" + ls_s + "', " + String(il_row) + ")")), YUnitsToPixels!)
IF ll_X = 0 OR ll_Y = 0 THEN RETURN
ll_Height = UnitsToPixels(Long(iDW.Describe(is_column + ".Height")), YUnitsToPixels!) + 2
ll_Split = UnitsToPixels(Long(iDW.Describe("DataWindow.HorizontalScrollSplit")), XUnitsToPixels!) - 1
IF ll_Split > 0 AND UnitsToPixels(iDW.PointerX(), XUnitsToPixels!) > ll_Split + 5 THEN
ll_X += - UnitsToPixels(Long(iDW.Describe("DataWindow.HorizontalScrollPosition2")), XUnitsToPixels!) + ll_Split + 5
ELSE
ll_X -= UnitsToPixels(Long(iDW.Describe("DataWindow.HorizontalScrollPosition")), XUnitsToPixels!)
END IF
ll_DWx = UnitsToPixels(iDW.X, XUnitsToPixels!)
ll_X += ll_DWx
ll_Y += UnitsToPixels(iDW.Y, YUnitsToPixels!) + UnitsToPixels(Long(iDW.Describe("DataWindow.Header.Height")), YUnitsToPixels!) + (il_row - Long(iDW.Describe("DataWindow.FirstRowOnPage"))) * UnitsToPixels(Long(iDW.Describe("DataWindow.Detail.Height")), YUnitsToPixels!) + 1
lPoint.X = ll_X
lPoint.Y = ll_Y
Externs.ClientToScreen(Externs.GetParent(Handle(iDW)), lPoint)
IF lPoint.X <= 0 THEN lPoint.X --
IF lPoint.X < 0 THEN lPoint.X = 0
IF lPoint.X + UnitsToPixels(This.Width, XUnitsToPixels!) > Env.ScreenWidth THEN
lPoint.X = Env.ScreenWidth - UnitsToPixels(This.Width, XUnitsToPixels!)
END IF
IF lPoint.Y + ll_Height + UnitsToPixels(This.Height, YUnitsToPixels!) > Env.ScreenHeight THEN
lPoint.Y -= UnitsToPixels(This.Height, YUnitsToPixels!)
ELSE
lPoint.Y += ll_Height
END IF
Move(PixelsToUnits(lPoint.X, XPixelsToUnits!), PixelsToUnits(lPoint.Y, YPixelsToUnits!))
If il_shadow_width > 0 Then iuo_shadow.CaptureDesktop(This)
Externs.SetWindowPos(Handle(This), -1, 0, 0, 0, 0, 67)
-----------------------------------
Appreciate the help.
TIA.
I am super glad that you found the error in your code! :-)
I suspect the correction in your POINT structure was also the root cause of your other API-related issue and why passing an eight-byte LongLong "worked". Translating the TypeDef'd datatypes used in the Windows API into the proper PB equivalent datatypes is extremely important.