Set Gadget Font via Windows API

Just starting out? Need help? Post your questions and find answers here.
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Set Gadget Font via Windows API

Post 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
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Set Gadget Font via Windows API

Post 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
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Post Reply