Page 2 of 2

Re: Set Gadget Font via Windows API

Posted: Mon Apr 10, 2017 4:39 pm
by Lunasole
bmcs wrote:No doubt I will give PB another try, but I will write a lot more "fun" code and pester you folks before I tackle a "real" job.
Well that's the right way :) Wish you luck with that "practice" stage

Re: Set Gadget Font via Windows API

Posted: Sun Jan 15, 2023 7:36 am
by boddhi
Reup this topic to correct an error if it can help.

I got, whatever the version of PB (5.31 to 6.00) I use, an error with this very interesting code of Rashad
Line 20 - Overflow in a dynamically allocated memory block
Therefore, I have changed the line :

Code: Select all

txtBuffer = AllocateMemory(length) : PokeS(txtBuffer, txt$, -1, #PB_Unicode)
to

Code: Select all

txtBuffer = AllocateMemory(length * 2) : PokeS(txtBuffer, txt$, -1, #PB_Unicode | #Pb_String_NoZero)
Regards