PureBasic 6.40 alpha 1 Open Save File

Post bugs related to the IDE here
User avatar
ChrisR
Addict
Addict
Posts: 1551
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

PureBasic 6.40 alpha 1 Open Save File

Post by ChrisR »

The IDE include in PB 6.40 alpha 1 (windows x64) crashes on Open or Save File
User avatar
ChrisR
Addict
Addict
Posts: 1551
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: PureBasic 6.40 alpha 1 Open Save File

Post by ChrisR »

I don't know if it can helps, but my application compiled with 6.40a1 also crashes on Open(Save)FileRequester, with OnErrorCall, I have:
Error Message: Unknown error code
Source Code File\Line = ProcedureReturn Result (#PB_ProcessPureBasicEvents) in my WinCallback

However, I tried to reproduce it with a simple code using SetWindowCallback() and OpenFileRequester() behind a button, but I cannot reproduce it here!

The rest, generating code with a lot of large string manipulation, seems to work well.
By adding a loop to the code generation to measure speed with a large interface, I go from 9 ms to 7 ms.
Knowing that most concatenations are done using ExString, but a 2 ms gain is always welcome, congrat :)
Fred
Administrator
Administrator
Posts: 18463
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureBasic 6.40 alpha 1 Open Save File

Post by Fred »

Could you give me the ErrorCode() value you get when using OpenFileRequester() ?
User avatar
ChrisR
Addict
Addict
Posts: 1551
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: PureBasic 6.40 alpha 1 Open Save File

Post by ChrisR »

Image

Code: Select all

Windows: 11 x64
IceDesign Version: 2.4.2
Source Code File: ObjectTheme.pbi
Source Code Line: 1245   (ProcedureReturn Result (#PB_ProcessPureBasicEvents) in ObjectTheme WinCallback)

Error Code: -529697949
Error Message: Unknown error code
fryquez
Enthusiast
Enthusiast
Posts: 394
Joined: Mon Dec 21, 2015 8:12 pm

Re: PureBasic 6.40 alpha 1 Open Save File

Post by fryquez »

With PB 6.40 you need to fix all strings modified by API or manual character length changes.

Code: Select all

CompilerIf #PB_Compiler_Version >= 640
  
  Procedure ResetStringLength(*s.Character)
    
    Protected *p.Integer = *s -SizeOf(Integer)
    *p\i = 0
    While *s\c
      *p\i + 1
      *s + SizeOf(Character)
    Wend
    
  EndProcedure
  
CompilerElse
  
  Macro ResetStringLength(s)
    ;
  EndMacro
  
CompilerEndIf
In your WinCallback() there you have GetClassName_() call

Code: Select all

Buffer = Space(64)
IF GetClassName_(ParentGadget, @Buffer, 64)
ResetStringLength(@Buffer)
User avatar
ChrisR
Addict
Addict
Posts: 1551
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: PureBasic 6.40 alpha 1 Open Save File

Post by ChrisR »

Oh! yes, thanks a lot fryquez and glad to see you around my friend :)
Well, I couldn't test it right away, I have lots of other space() and strings modified by API elsewhere to correct too.
But that's the right track, indeed, I didn't think beyond the end of my nose.
And thanks also for the ResetStringLength() macro/procedure.

So, there must be something similar in the IDE as well!
Fred
Administrator
Administrator
Posts: 18463
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureBasic 6.40 alpha 1 Open Save File

Post by Fred »

Thanks for the error code, should be fixed for the next alpha
Post Reply