[SOLVED] 32 bit OK But 64 bit Broken

Just starting out? Need help? Post your questions and find answers here.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

[SOLVED] 32 bit OK But 64 bit Broken

Post by Randy Walker »

This code highlights perfectly if I compile in 5.40x32 but if I compile in 64 bit on 5.40 or 5.63 or 6.20 it does not do any highlight.
Please note it is the spotSearch() procedure that does the highlights (or should).

Code: Select all

Global Output$, HelpText5
Procedure gettext()
cmd$ = "powershell.exe"
param$ = "(curl https://www.purebasic.com/documentation/reference/ide_commandline.html).Content"
exe = RunProgram(cmd$,param$,"", 2 | 4 | 8) ;
Output$ = "" 
If exe
  Debug "PLEASE WAIT A MOMENT ! ! !"
  While ProgramRunning(exe)
    s$ = ReadProgramString(exe) + Chr(13)
    If Len(s$) > 2
      Output$ +s$
    EndIf
    ;Debug er$
  Wend
  Output$ + Chr(13) + Chr(13)
  Output$ + "Exitcode: " + Str(ProgramExitCode(exe))
 Output$ + "            -- END --"
EndIf
EndProcedure
gettext()
;Debug Output$


#Window_5 = 0
Enumeration
    #UserPick_5
  #PrvUsr_5
  #NxtUsr_5
  #ViewPhoto_5
  #F4_5
  #Back_5
  #Next_5
  #Close_5
  #HelpText_5
EndEnumeration

Structure myCHARFORMAT2 ; --> Structure for formatting EditorGadget 
  cbSize.i 
  dwMask.i 
  dwEffects.i 
  yHeight.i 
  yOffset.i 
  crTextColor.i 
  bCharSet.B 
  bPitchAndFamily.B 
  szFaceName.B[#LF_FACESIZE] 
  nullPad.W 
  wWeight.W 
  sSpacing.W 
  crBackColor.i 
  LCID.i 
  dwReserved.i 
  sStyle.W 
  wKerning.W 
  bUnderlineType.B 
  bAnimation.B 
  bRevAuthor.B 
  bReserved1.B 
EndStructure 
#CFM_BACKCOLOR = $4000000 ;FindText highlightings
Global defaultFormat.myCHARFORMAT2, editFind.FINDTEXT, helpFormat.myCHARFORMAT2, Range.CHARRANGE
Global editFormat.myCHARFORMAT2, CursorPosition.POINT,ErrorMessage$
; --> Find text from start to end of text : spotSearch(CtrlID,textToFind1$,textToFind2$,textToFind3$)
; --> Find text from start to end of text : spotSearch(CtrlID,textToFind1$,textToFind2$,textToFind3$)
editFind.FINDTEXT 
editFind\chrg\cpMin = 0  ; this will change in procedure as text is found 
editFind\chrg\cpMax = -1 
  ; --> Our found text background 
editFormat.myCHARFORMAT2
editFormat\cbSize = SizeOf(myCHARFORMAT2) 
editFormat\dwMask = #CFM_BACKCOLOR 
editFormat\crBackColor = RGB(255, 205, 225) 
  ; --> Our default EditorGdaget background color 
defaultFormat.myCHARFORMAT2 
defaultFormat\cbSize = SizeOf(myCHARFORMAT2) 
defaultFormat\dwMask = #CFM_BACKCOLOR 
defaultFormat\crBackColor = RGB(255, 255, 255)
  ; --> Our default Help window gadget background color 
helpFormat.myCHARFORMAT2 
helpFormat\cbSize = SizeOf(myCHARFORMAT2) 
helpFormat\dwMask = #CFM_BACKCOLOR 
helpFormat\crBackColor = $9B9BFF

fontSan10.i = LoadFont(#PB_Default,"MS Sans Serif",10)

HWND5 = OpenWindow(#Window_5, 0,0,631,600, "TroubleShooting",  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar)
  If HWND5
    UserPick5 = ComboBoxGadget(#UserPick_5, 31, 0, 159, 20)
    ButtonGadget(#PrvUsr_5, 0, 0, 30, 20, "<< |")
    ButtonGadget(#NxtUsr_5, 190, 0, 30, 20, "| >>")
    ViewPhoto5 = ButtonGadget(#ViewPhoto_5, -5, 0, 225, 25, "&View Photo")
    ButtonGadget(#F4_5, 220, 0, 120, 25, "[F4] CLIPBOARD")
    ButtonGadget(#Back_5, 340, 0, 110, 25, "<<< &BACK   ")
    ButtonGadget(#Next_5, 450, 0, 100, 25, "  &NEXT >>>")
    ButtonGadget(#Close_5, 550, 0, 80, 25, "CLOSE")
    SetGadgetFont(#PB_Default,FontID(fontSan10.i))
    HelpText5 = EditorGadget(#HelpText_5, -2, 25, 625, 570)
    SendMessage_(HelpText5, #EM_SETTARGETDEVICE, #Null, 0) ; 0=wrap , 1up=linewidth , $FFFFFF(effectively)=wrapoff
    SendMessage_(HelpText5, #EM_SETREADONLY, 1, 0) 
    SendMessage_(HelpText5, #EM_SETBKGNDCOLOR, 0, RGB(255, 255, 255))
    SetGadgetText(#HelpText_5, "HelpText")
    HideGadget(#PrvUsr_5,1)
    HideGadget(#NxtUsr_5,1)
    HideGadget(#UserPick_5,1)
  EndIf
SetGadgetText(#HelpText_5,Output$)
Procedure spotSearch(CtrlID,textToFind1$,textToFind2$,textToFind3$)
  If textToFind1$ <> "a"
    ShowWindow_(CtrlID,#SW_HIDE)
    ; --> Reset search to beginnng 
    SendMessage_(CtrlID, #EM_SETSEL, 0, 0) 
    ; --> For resetting to default text 
    ;SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_ALL, defaultFormat) 
    SendMessage_(CtrlID, #EM_SETCHARFORMAT, 0, defaultFormat) 
    PostMessage_(HelpText5, #EM_SETREADONLY, 1, 0)
    ; --> Split the seaarch words 
    spaces = CountString(textToFind1$, " ")  
    For i = 1 To spaces+1 
      editFind\chrg\cpMin = 0 
      thisFind$ = StringField(textToFind1$, i, " ") 
      editFind\lpstrText = @thisFind$ 
      Repeat 
        found = SendMessage_(CtrlID, #EM_FINDTEXT, #FR_DOWN, editFind) 
        If found > -1 
          editFind\chrg\cpMin = found+1 
          ; --> Set the selection to colorize 
          SendMessage_(CtrlID, #EM_SETSEL, found, found + Len(thisFind$))  
          ; --> Colorize selection background 
          SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_SELECTION | #SCF_WORD, editFormat) 
        EndIf 
      Until found = -1 ;/   COLOR SETTINGS AT TOP OF PROGRAM LISTING
    Next i 
    If Len(textToFind2$)  ;/           See: myCHARFORMAT2
      ; --> Split the seaarch words 
      spaces = CountString(textToFind2$, " ")  
      For i = 1 To spaces+1 
        editFind\chrg\cpMin = 0 
        thisFind$ = StringField(textToFind2$, i, " ") 
        editFind\lpstrText = @thisFind$ 
        Repeat 
          found = SendMessage_(CtrlID, #EM_FINDTEXT, #FR_DOWN, editFind) 
          If found > -1 
            editFind\chrg\cpMin = found+1 
            ; --> Set the selection to colorize 
            SendMessage_(CtrlID, #EM_SETSEL, found, found + Len(thisFind$))  
            ; --> Colorize selection background 
            SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_SELECTION | #SCF_WORD, editFormat) 
          EndIf 
        Until found = -1 
      Next i 
    EndIf
    If Len(textToFind3$)
      ; --> Split the seaarch words 
      spaces = CountString(textToFind3$, " ")  
      For i = 1 To spaces+1 
        editFind\chrg\cpMin = 0 
        thisFind$ = StringField(textToFind3$, i, " ") 
        editFind\lpstrText = @thisFind$ 
        Repeat 
          found = SendMessage_(CtrlID, #EM_FINDTEXT, #FR_DOWN, editFind) 
          If found > -1 
            editFind\chrg\cpMin = found+1 
            ; --> Set the selection to colorize 
            SendMessage_(CtrlID, #EM_SETSEL, found, found + Len(thisFind$))  
            ; --> Colorize selection background 
            SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_SELECTION | #SCF_WORD, editFormat) 
          EndIf 
        Until found = -1 
      Next i 
    EndIf
    ShowWindow_(CtrlID,#SW_SHOW)
    SendMessage_(CtrlID, #EM_SETSEL, 0, 0) 
  EndIf
EndProcedure 
textToFind1$ = "the"
textToFind2$ = "or"
textToFind3$ = "is"
spotSearch(HelpText5,textToFind1$,textToFind2$,textToFind3$)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
I'm sorry i didn't make note of who I got that highlighting code from -- Not my invention.
Is it an API problem? Maybe all Those APIs belong to 32 Bit OS only?
Last edited by Randy Walker on Tue Jun 10, 2025 6:53 pm, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
idle
Always Here
Always Here
Posts: 5888
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: 32 bit OK But 64 bit Broken

Post by idle »

Works for me with win11 6.20 x64 and x86
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: 32 bit OK But 64 bit Broken

Post by Randy Walker »

idle wrote: Tue Jun 10, 2025 4:22 am Works for me with win11 6.20 x64 and x86
Okayy. Any idea what could be different between your win 11 6.20 x64 and mine that could account for that?
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
idle
Always Here
Always Here
Posts: 5888
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: 32 bit OK But 64 bit Broken

Post by idle »

Randy Walker wrote: Tue Jun 10, 2025 4:41 am
idle wrote: Tue Jun 10, 2025 4:22 am Works for me with win11 6.20 x64 and x86
Okayy. Any idea what could be different between your win 11 6.20 x64 and mine that could account for that?
no, no idea? It looked and worked the same on x68 and x64
User avatar
STARGÅTE
Addict
Addict
Posts: 2228
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: 32 bit OK But 64 bit Broken

Post by STARGÅTE »

I think the structure myCHARFORMAT2 is wrong.
The original structure definition CHARFORMATA defines Mask, Effects, Width, ... as DWORD or LONG (32 bit), which is equal to .l in PureBasic, not to .i

Please check the whole structure.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: 32 bit OK But 64 bit Broken

Post by Randy Walker »

STARGÅTE wrote: Tue Jun 10, 2025 6:50 am I think the structure myCHARFORMAT2 is wrong.
The original structure definition CHARFORMATA defines Mask, Effects, Width, ... as DWORD or LONG (32 bit), which is equal to .l in PureBasic, not to .i

Please check the whole structure.
No idea how to do that.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: 32 bit OK But 64 bit Broken

Post by Caronte3D »

Try what STARGÅTE said:

change:
dwMask.i
dwEffects.i

for:
dwMask.l
dwEffects.l

And try
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: 32 bit OK But 64 bit Broken

Post by Randy Walker »

Caronte3D wrote: Tue Jun 10, 2025 7:47 am Try what STARGÅTE said:

change:
dwMask.i
dwEffects.i

for:
dwMask.l
dwEffects.l

And try
OK, Done and done. Still works in x86 but still not working in the x64.
Based on those changes to structure variables beginning with dw I also tried changing dwReserved.i to dwReserved.l but till no positive affect.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
drgolf
Enthusiast
Enthusiast
Posts: 106
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

Re: 32 bit OK But 64 bit Broken

Post by drgolf »

on windows 10 PRO x64, with PB 6.21

Work with x86 and x64 asm and C BE

Code: Select all

Global Output$, HelpText5
Procedure gettext()
cmd$ = "powershell.exe"
param$ = "(curl https://www.purebasic.com/documentation/reference/ide_commandline.html).Content"
exe = RunProgram(cmd$,param$,"", 2 | 4 | 8) ;
Output$ = "" 
If exe
  Debug "PLEASE WAIT A MOMENT ! ! !"
  While ProgramRunning(exe)
    s$ = ReadProgramString(exe) + Chr(13)
    If Len(s$) > 2
      Output$ +s$
    EndIf
    ;Debug er$
  Wend
  Output$ + Chr(13) + Chr(13)
  Output$ + "Exitcode: " + Str(ProgramExitCode(exe))
 Output$ + "            -- END --"
EndIf
EndProcedure
gettext()
;Debug Output$


#Window_5 = 0
Enumeration
    #UserPick_5
  #PrvUsr_5
  #NxtUsr_5
  #ViewPhoto_5
  #F4_5
  #Back_5
  #Next_5
  #Close_5
  #HelpText_5
EndEnumeration

; Structure myCHARFORMAT2 ; --> Structure for formatting EditorGadget 
;   cbSize.l 
;   dwMask.l 
;   dwEffects.l 
;   yHeight.l 
;   yOffset.l 
;   crTextColor.l 
;   bCharSet.B 
;   bPitchAndFamily.B 
;   szFaceName.B[#LF_FACESIZE] 
;   nullPad.W 
;   wWeight.W 
;   sSpacing.W 
;   crBackColor.l 
;   LCID.i 
;   dwReserved.l 
;   sStyle.W 
;   wKerning.W 
;   bUnderlineType.B 
;   bAnimation.B 
;   bRevAuthor.B 
;   bReserved1.B 
; EndStructure 
#CFM_BACKCOLOR = $4000000 ;FindText highlightings
Global defaultFormat.CHARFORMAT2, editFind.FINDTEXT, helpFormat.CHARFORMAT2, Range.CHARRANGE
Global editFormat.CHARFORMAT2, CursorPosition.POINT,ErrorMessage$
; --> Find text from start to end of text : spotSearch(CtrlID,textToFind1$,textToFind2$,textToFind3$)
; --> Find text from start to end of text : spotSearch(CtrlID,textToFind1$,textToFind2$,textToFind3$)
editFind.FINDTEXT 
editFind\chrg\cpMin = 0  ; this will change in procedure as text is found 
editFind\chrg\cpMax = -1 
  ; --> Our found text background 
editFormat.CHARFORMAT2
editFormat\cbSize = SizeOf(CHARFORMAT2) 
editFormat\dwMask = #CFM_BACKCOLOR 
editFormat\crBackColor = RGB(255, 205, 225) 
  ; --> Our default EditorGdaget background color 
defaultFormat.CHARFORMAT2 
defaultFormat\cbSize = SizeOf(CHARFORMAT2) 
defaultFormat\dwMask = #CFM_BACKCOLOR 
defaultFormat\crBackColor = RGB(255, 255, 255)
  ; --> Our default Help window gadget background color 
helpFormat.CHARFORMAT2 
helpFormat\cbSize = SizeOf(CHARFORMAT2) 
helpFormat\dwMask = #CFM_BACKCOLOR 
helpFormat\crBackColor = $9B9BFF

fontSan10.i = LoadFont(#PB_Default,"MS Sans Serif",10)

HWND5 = OpenWindow(#Window_5, 0,0,631,600, "TroubleShooting",  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar)
  If HWND5
    UserPick5 = ComboBoxGadget(#UserPick_5, 31, 0, 159, 20)
    ButtonGadget(#PrvUsr_5, 0, 0, 30, 20, "<< |")
    ButtonGadget(#NxtUsr_5, 190, 0, 30, 20, "| >>")
    ViewPhoto5 = ButtonGadget(#ViewPhoto_5, -5, 0, 225, 25, "&View Photo")
    ButtonGadget(#F4_5, 220, 0, 120, 25, "[F4] CLIPBOARD")
    ButtonGadget(#Back_5, 340, 0, 110, 25, "<<< &BACK   ")
    ButtonGadget(#Next_5, 450, 0, 100, 25, "  &NEXT >>>")
    ButtonGadget(#Close_5, 550, 0, 80, 25, "CLOSE")
    SetGadgetFont(#PB_Default,FontID(fontSan10.i))
    HelpText5 = EditorGadget(#HelpText_5, -2, 25, 625, 570)
    
    SendMessage_(GadgetID(#HelpText_5), #EM_SETTEXTMODE, #TM_RICHTEXT, 0) ;<<<<<<<<<<<<<<<<<<<<<<<<<< RICHTEXT>>>>>>>>>>>>>>>>>>>>>
    
    SendMessage_(HelpText5, #EM_SETTARGETDEVICE, #Null, 0) ; 0=wrap , 1up=linewidth , $FFFFFF(effectively)=wrapoff
    SendMessage_(HelpText5, #EM_SETREADONLY, 1, 0) 
    SendMessage_(HelpText5, #EM_SETBKGNDCOLOR, 0, RGB(255, 255, 255))
    SetGadgetText(#HelpText_5, "HelpText")
    HideGadget(#PrvUsr_5,1)
    HideGadget(#NxtUsr_5,1)
    HideGadget(#UserPick_5,1)
  EndIf
SetGadgetText(#HelpText_5,Output$)
Procedure spotSearch(CtrlID,textToFind1$,textToFind2$,textToFind3$)
  If textToFind1$ <> "a"
    ShowWindow_(CtrlID,#SW_HIDE)
    ; --> Reset search to beginnng 
    SendMessage_(CtrlID, #EM_SETSEL, 0, 0) 
    ; --> For resetting to default text 
    ;SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_ALL, defaultFormat) 
    SendMessage_(CtrlID, #EM_SETCHARFORMAT, 0, defaultFormat) 
    PostMessage_(HelpText5, #EM_SETREADONLY, 1, 0)
    ; --> Split the seaarch words 
    spaces = CountString(textToFind1$, " ")  
    For i = 1 To spaces+1 
      editFind\chrg\cpMin = 0 
      thisFind$ = StringField(textToFind1$, i, " ") 
      editFind\lpstrText = @thisFind$ 
      Repeat 
        found = SendMessage_(CtrlID, #EM_FINDTEXT, #FR_DOWN, editFind) 
        If found > -1 
          editFind\chrg\cpMin = found+1 
          ; --> Set the selection to colorize 
          SendMessage_(CtrlID, #EM_SETSEL, found, found + Len(thisFind$))  
          ; --> Colorize selection background 
          SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_SELECTION | #SCF_WORD, editFormat) 
        EndIf 
      Until found = -1 ;/   COLOR SETTINGS AT TOP OF PROGRAM LISTING
    Next i 
    If Len(textToFind2$)  ;/           See: myCHARFORMAT2
      ; --> Split the seaarch words 
      spaces = CountString(textToFind2$, " ")  
      For i = 1 To spaces+1 
        editFind\chrg\cpMin = 0 
        thisFind$ = StringField(textToFind2$, i, " ") 
        editFind\lpstrText = @thisFind$ 
        Repeat 
          found = SendMessage_(CtrlID, #EM_FINDTEXT, #FR_DOWN, editFind) 
          If found > -1 
            editFind\chrg\cpMin = found+1 
            ; --> Set the selection to colorize 
            SendMessage_(CtrlID, #EM_SETSEL, found, found + Len(thisFind$))  
            ; --> Colorize selection background 
            SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_SELECTION | #SCF_WORD, editFormat) 
          EndIf 
        Until found = -1 
      Next i 
    EndIf
    If Len(textToFind3$)
      ; --> Split the seaarch words 
      spaces = CountString(textToFind3$, " ")  
      For i = 1 To spaces+1 
        editFind\chrg\cpMin = 0 
        thisFind$ = StringField(textToFind3$, i, " ") 
        editFind\lpstrText = @thisFind$ 
        Repeat 
          found = SendMessage_(CtrlID, #EM_FINDTEXT, #FR_DOWN, editFind) 
          If found > -1 
            editFind\chrg\cpMin = found+1 
            ; --> Set the selection to colorize 
            SendMessage_(CtrlID, #EM_SETSEL, found, found + Len(thisFind$))  
            ; --> Colorize selection background 
            SendMessage_(CtrlID, #EM_SETCHARFORMAT, #SCF_SELECTION | #SCF_WORD, editFormat) 
          EndIf 
        Until found = -1 
      Next i 
    EndIf
    ShowWindow_(CtrlID,#SW_SHOW)
    SendMessage_(CtrlID, #EM_SETSEL, 0, 0) 
  EndIf
EndProcedure 
textToFind1$ = "the"
textToFind2$ = "or"
textToFind3$ = "is"
spotSearch(HelpText5,textToFind1$,textToFind2$,textToFind3$)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: 32 bit OK But 64 bit Broken

Post by Quin »

You've still got a .i in there. As far as I know almost no Windows API functions use variably-sized integers, it's mostly DWORD/BOOL (32-bit unsigned integers) or similar. I guess that's partially why they call it Win32 :D
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: 32 bit OK But 64 bit Broken

Post by Randy Walker »

Quin wrote: Tue Jun 10, 2025 2:30 pm You've still got a .i in there. As far as I know almost no Windows API functions use variably-sized integers, it's mostly DWORD/BOOL (32-bit unsigned integers) or similar. I guess that's partially why they call it Win32 :D
Uhh, well. Somebody told me to get my main project working in the x64 PB releases I would need to use search and replace to change All of my .i integers to .l instead, so I did. No way to know now but they may very well have all been .l to begin with. I'll switch them back to .l and see what happens. Thanks for that comment.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: 32 bit OK But 64 bit Broken

Post by Quin »

Hi Randy,
This is slightly confusing at first.
handles returned by PB, for example from OpenWindow, CatchJSON, etc with #PB_Any, should be .i.
However, the Windows API is quite old, predating 64-bit, and so many of their APIs use longs.
The general rule is: use integers unless you're talking to the API, then use *exactly* what the API tells you to.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: 32 bit OK But 64 bit Broken

Post by Randy Walker »

Quin wrote: Tue Jun 10, 2025 2:30 pm You've still got a .i in there.
Hi Quin : You were quite correct - you solved the problem!
Changing all those .i to .l fixed the problem.
THANKS QUIN!!!
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Quin
Addict
Addict
Posts: 1132
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [SOLVED] 32 bit OK But 64 bit Broken

Post by Quin »

:) happy to help. Glad you got it working!
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: 32 bit OK But 64 bit Broken

Post by Randy Walker »

Quin wrote: Tue Jun 10, 2025 6:46 pm Hi Randy,
This is slightly confusing at first.
handles returned by PB, for example from OpenWindow, CatchJSON, etc with #PB_Any, should be .i.
However, the Windows API is quite old, predating 64-bit, and so many of their APIs use longs.
The general rule is: use integers unless you're talking to the API, then use *exactly* what the API tells you to.
Ok. Thanks for the added lesson there Quin!!
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Post Reply