Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => C++ programming (SDK style) => Topic started by: James C. Fuller on December 04, 2014, 09:40:55 PM

Title: PowerBASIC Address example converted
Post by: James C. Fuller on December 04, 2014, 09:40:55 PM
Patrice,
This is "c" not c++ so I hope it's ok to post here.
This isn't complete but I want to get back to my c++ studies using Visual Studio 2013 Community and the mfc.
I first found out I needed to convert the ADDRESS.DAT file so I could work with zero padded unicode strings.
I used your PowerBASIC SDK framework with my resource dialog.

Attached are two different versions. One for TinyC 9.26 64bit and one for all the other's.

The TinyC version comes in at 19K while the Visual Studio 2013 Community is 98k.
I'm sure you can get this down. I don't do much optimizing when compiling with my batch files.

PellesC -> 51k
TDM-GCC -> 30k
NUWEN   -> 31k

I ran into one strange..??

this works with TinyC 9.26 64bit    no buffer size here ????

   swprintf(gBuf, L"%ld%ls%ld", gP.currententry,L" /",gP.maxentries)

this is the correct call needed for all other compilers VC++,PellesC,TDM-GCC,NUWEN

   swprintf(gBuf, GBUF_SIZE,L"%ld%ls%ld", gP.currententry,L" /",gP.maxentries)




I also attached the bc9Basic code used to produce the "c" source.

James
Title: Re: PowerBASIC Address example converted
Post by: Patrice Terrier on December 05, 2014, 10:01:36 AM
James--

I am half way in the c++ convert process of my sdkaddress.bas.

Wait and see...

:)