Search found 22 matches

by gltianya
Sat Nov 15, 2025 3:28 am
Forum: Coding Questions
Topic: [solved] pb v6.21 compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.
Replies: 9
Views: 1005

Re: [solved] pb v6.21 compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.

mk-soft wrote: Fri Nov 14, 2025 6:28 pm Many APIs can be maintained with import yourself if they are also present in windows lib file.
If not, you have to load the function with OpenLibrary, or replace the lib file.
Thank you. Yes, I found the root cause and solved it myself by importing references.

Code: Select all

 Import
  ...
 
 EndImport
 
by gltianya
Fri Nov 14, 2025 5:28 pm
Forum: Coding Questions
Topic: [solved] pb v6.21 compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.
Replies: 9
Views: 1005

Re: [pb 6.21] compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.

I am a big fan of the PureBasic language—it is excellent. Both its syntax and the resulting executables are straightforward and efficient. I understand your explanation and have tried to comprehend it from the perspective of code generation by the compiler. Regarding Windows API functions like ...
by gltianya
Fri Nov 14, 2025 11:18 am
Forum: Coding Questions
Topic: [solved] pb v6.21 compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.
Replies: 9
Views: 1005

Re: [pb 6.21] compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.


This is a Windows API call. Just because it's not defined, doesn't mean it's a bug. You can define it by yourself.
BTW: A lot of APIs are not defined by default...

"I understand your explanation, but I don't quite agree with it. When the same code, compiled with the same compiler version ...
by gltianya
Fri Nov 14, 2025 6:20 am
Forum: Coding Questions
Topic: [solved] pb v6.21 compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.
Replies: 9
Views: 1005

Re: [pb 6.21] compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.


Not a bug, InterlockedExchangeAddoperates with 32 bit values. Using InterlockedExchangeAdd64 will work.

The sources you linked also say this.

[13:20:01] [COMPILER] Line 3: InterlockedExchangeAdd64_() is not a function, array, list, map or macro.
[13:21:20] [COMPILER] Line 11 ...
by gltianya
Thu Nov 13, 2025 7:25 pm
Forum: Coding Questions
Topic: [solved] pb v6.21 compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.
Replies: 9
Views: 1005

[solved] pb v6.21 compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.

Hello, the following code compiles successfully under PureBasic x86, but an error occurs under PureBasic x64.

; Define atomic functions for different platforms (Windows)
Procedure AtomicAdd(*Variable, Value)
*Variable = InterlockedExchangeAdd_(*Variable, Value)
EndProcedure

Procedure ...
by gltianya
Fri Sep 13, 2024 6:38 pm
Forum: Announcement
Topic: PureBasic 6.12 LTS is out !
Replies: 92
Views: 62771

Re: PureBasic 6.12 LTS is out !

Thank you Fred and PB team
by gltianya
Fri Sep 13, 2024 6:20 pm
Forum: Coding Questions
Topic: [Solved] PB 6.12 b1 An error occurred when using UncompressPackMemory or UncompressPackFile to decompress a zip archive
Replies: 3
Views: 2451

Re: PB 6.12 b1 An error occurred when using UncompressPackMemory or UncompressPackFile to decompress a zip archive

After repeated tests and careful reading of the help file, because the Windows system code page of my computer is not the default English (ASCII) encoding, but the default encoding (unicode) of pb. The Chinese file encoding in the compressed package created by 7zip or winrar uses the system code ...
by gltianya
Wed Aug 28, 2024 2:09 pm
Forum: Coding Questions
Topic: pb6.12b3 Not sure if it is a peeks bug?
Replies: 14
Views: 2972

Re: pb6.12b3 Not sure if it is a peeks bug?


Limit String does not mean that String can be infinitely large. A contiguous memory must be provided by the operating system for this. This cannot always be successful if there is not enough contiguous memory available.
This is not a bug of Purebasic.
You should also not work with such large ...
by gltianya
Wed Aug 28, 2024 10:26 am
Forum: Coding Questions
Topic: pb6.12b3 Not sure if it is a peeks bug?
Replies: 14
Views: 2972

Re: pb6.12b3 Not sure if it is a peeks bug?


With this line:
filetext$ = PeekS(*UnpackID, Result, #PB_UTF8|#PB_ByteLength)
It works with PB 6.11 x86 on Wind10 x64.

Hint:
The filename LargeDocument.docx needs to be inside AllResults-v2.txt


I tried inserting a line
filetext$ = space(Result)
before the code
filetext$ = PeekS ...
by gltianya
Tue Aug 27, 2024 8:17 am
Forum: Coding Questions
Topic: pb6.12b3 Not sure if it is a peeks bug?
Replies: 14
Views: 2972

Re: pb6.12b3 Not sure if it is a peeks bug?


With this line:
filetext$ = PeekS(*UnpackID, Result, #PB_UTF8|#PB_ByteLength)
It works with PB 6.11 x86 on Wind10 x64.

Hint:
The filename LargeDocument.docx needs to be inside AllResults-v2.txt


AllResults-v2.txt is a list of the absolute paths of all DOCX files on my computer, encoded in utf ...
by gltianya
Mon Aug 26, 2024 4:37 pm
Forum: Coding Questions
Topic: pb6.12b3 Not sure if it is a peeks bug?
Replies: 14
Views: 2972

Re: pb6.12b3 Not sure if it is a peeks bug?

Fred wrote: Mon Aug 26, 2024 4:21 pm Try with the #PB_ByteLength flag
I try modified
filetext$ = PeekS(*UnpackID, Result, #PB_UTF8 | #PB_ByteLength)
, The problem was not resolved.
by gltianya
Mon Aug 26, 2024 4:21 pm
Forum: Coding Questions
Topic: pb6.12b3 Not sure if it is a peeks bug?
Replies: 14
Views: 2972

Re: pb6.12b3 Not sure if it is a peeks bug?


Ok, two things:
First, we can't really reproduce this without the original files.
Second, if it's not confirmed as a bug, then post it somewhere else, not the bug section. It can be moved there later by an admin, after confirmation.


I don't know how to upload the original DOCX file to the forum ...
by gltianya
Mon Aug 26, 2024 3:46 pm
Forum: Coding Questions
Topic: pb6.12b3 Not sure if it is a peeks bug?
Replies: 14
Views: 2972

Re: pb6.12b3 Not sure if it is a peeks bug?

jacdelad wrote: Mon Aug 26, 2024 3:41 pm I don't have your files, so I can just guess:
Does ist work with

Code: Select all

filetext$ = PeekS(*UnpackID, -1, #PB_UTF8)
?
Thanks, I'll try your code right away.

Just tested, the problem still exists.
by gltianya
Mon Aug 26, 2024 3:20 pm
Forum: Coding Questions
Topic: pb6.12b3 Not sure if it is a peeks bug?
Replies: 14
Views: 2972

pb6.12b3 Not sure if it is a peeks bug?

Not sure if it is a peeks bug, please check the following code. Code 1 has an error in the peeks function when accessing a file.
thanks!
line: filetext$ = PeekS(*UnpackID, Result, #PB_UTF8)
https://drive.google.com/file/d/1sLYzrArVtksVhLrS-KWTkgOvOh-BhiCS/view?usp=sharing

; code 1 ...
by gltianya
Mon Aug 12, 2024 2:59 am
Forum: Coding Questions
Topic: [Solved] PB 6.12 b1 An error occurred when using UncompressPackMemory or UncompressPackFile to decompress a zip archive
Replies: 3
Views: 2451

Re: 【PB 6.12 b1】An error occurred when using UncompressPackMemory or UncompressPackFile to decompress a zip archive

This is caused by my coding error, not a bug. Please move it to the appropriate region or delete this post. Thank you.