FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH 26.03 betatesters wanted
Posts: 137
Joined: Mon Oct 22, 2012 04:43 PM
Re: FWH 26.03 betatesters wanted
Posted: Wed Mar 25, 2026 05:43 PM

Language german,
BCC77064 compile, message is ok
MSVC32 compile, message is ok
MSVC64 compile, message is not ok
fwstring() for MSVC64bit seems not good for öäü..

msg_fwstring.prg

// Typical exit message, from Windows!

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()
   FWSetLanguage( 5 )  // 1 english, 2 spanish, 3 french, 5 german, 6 italian
   MsgYesNo( fwstring("Want to End ?" ) )
   

return nil

//----------------------------------------------------------------------------//
Regards



Ing. Anton Lerchster
Posts: 137
Joined: Mon Oct 22, 2012 04:43 PM
Re: FWH 26.03 betatesters wanted
Posted: Wed Mar 25, 2026 05:50 PM

fivedbu.prg

sprintf should be changed to sprintf_s
change code after line 364 with claude's answer

#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( FW_EXITPROCESS ) { ExitProcess( 0 ); }
HB_FUNC( CCOMPILER )
{
   #ifdef __clang__
      hb_retc( "LLVM/Clang " __clang_version__ );
   #elif defined( __GNUC__ )
      hb_retc( "GCC " __VERSION__ );
   #elif defined( _MSC_VER )
      char buf[ 32 ];
      sprintf_s( buf, sizeof( buf ), "MSVC %d", _MSC_VER );
      hb_retc( buf );
   #elif defined( __BORLANDC__ )
      char buf[ 32 ];
      sprintf_s( buf, sizeof( buf ), "BCC 0x%04X", __BORLANDC__ );
      hb_retc( buf );
   #else
      hb_retc( "Unknown" );
   #endif
}
#pragma ENDDUMP
Regards



Ing. Anton Lerchster
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 26.03 betatesters wanted
Posted: Wed Mar 25, 2026 08:45 PM

Dear Anton,

Do you have Claude code ? If not I strongly advise you to use it

You won't believe how powerful it is until you use it. It will change your programming experience for ever :wink: :idea:

Using Claude code now every Harbour and FWH user becomes a truly engineer to enhance our platform! :idea:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 26.03 betatesters wanted
Posted: Wed Mar 25, 2026 09:01 PM
alerchster wrote:

fivedbu.prg

sprintf should be changed to sprintf_s
change code after line 364 with claude's answer

#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( FW_EXITPROCESS ) { ExitProcess( 0 ); }
HB_FUNC( CCOMPILER )
{
   #ifdef __clang__
      hb_retc( "LLVM/Clang " __clang_version__ );
   #elif defined( __GNUC__ )
      hb_retc( "GCC " __VERSION__ );
   #elif defined( _MSC_VER )
      char buf[ 32 ];
      sprintf_s( buf, sizeof( buf ), "MSVC %d", _MSC_VER );
      hb_retc( buf );
   #elif defined( __BORLANDC__ )
      char buf[ 32 ];
      sprintf_s( buf, sizeof( buf ), "BCC 0x%04X", __BORLANDC__ );
      hb_retc( buf );
   #else
      hb_retc( "Unknown" );
   #endif
}
#pragma ENDDUMP

Dear Anton,

Claude code analysis:

We don't need sprintf_s here because:

The buffer is 32 bytes and the output is at most 15 characters (e.g. "MSVC 1943", "BCC 0x0770"). There is zero
overflow risk.

Technical reasons to avoid it:

  1. Portability: sprintf_s is a Microsoft extension (Annex K of C11, which is optional). BCC32, GCC, and Clang on
    Windows don't implement it — the code won't compile on 4 of our 6 target compilers.

  2. No safety gain: sprintf_s guards against buffer overruns by taking sizeof(buf) as a parameter. When the format
    string is a fixed literal with a single %d or %04X and the buffer is 2x larger than needed, the check adds nothing.

  3. sprintf is standard C89: works on every compiler we support (BCC32, BCC32C/Clang, MSVC32, MSVC64, GCC32, GCC64).

    Bottom line: use sprintf for cross-compiler compatibility. Reserve sprintf_s for cases where the format string or data
    comes from user input and the buffer size is tight.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 137
Joined: Mon Oct 22, 2012 04:43 PM
Re: FWH 26.03 betatesters wanted
Posted: Wed Mar 25, 2026 09:43 PM

Dear Antonio,

Yes, I've been using Claude since December, first with the Pro plan and now with the Max plan. It's a fantastic tool and, as you've already mentioned, it transforms development from a programmer to an architect. It brought my local Ubuntu server online via Cloudflare and set up several dynamic websites for me with 2FA via email and then with Microsoft Authenticator, etc., using PHP and a MySQL database. It did require some tweaks, but it led to a positive result very quickly.

When compiling FiveDBU, I got a warning with MSVC that sprintf was insecure and should be replaced with sprintf_s. I then had Claude rewrite that part of the code to sprintf_s, and that was the result. I agree with you, it was just a warning and didn't affect the functionality in this case. :-)

Regards



Ing. Anton Lerchster
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 26.03 betatesters wanted
Posted: Wed Mar 25, 2026 10:45 PM

There is a new FWH 26.03 beta ready

Please ask for it on whatsapp, thank you :idea: :)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 08:25 AM

You can use

-D_CRT_SECURE_NO_WARNINGS
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 10:30 AM

Hi Mr Antonio,

Everything seems to be fine.
Some of the classes I customized had different function names—for example:
xChangeProc() is now xxChangeProc() — but I’ve already fixed that.

Is it just me, or does everything seem faster and smoother?

Anyway, congratulations on the great work.

I’ll get organized and send you the 170 euros for the product — it’s worth every penny.

🤩

Posts: 38
Joined: Thu Aug 04, 2022 12:45 PM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 11:34 AM

HI, i want , thank you.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 11:56 AM

Please send a whatsapp to +34 722461100 :!: :)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 12:46 PM

Dear Antonio,

Please Look it.
I use New version Chinese input way, but not work
But I use Old version Chinese input way. It's working.

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 137
Joined: Mon Oct 22, 2012 04:43 PM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 04:15 PM

fivedbu.prg

compiled with BCC770 32 Bit runs OK compiled with MSVC 32 and 64 Bit some Dialogs will not be shown example: "Setup" "Preferences", Buttonbar "Search" and many more

fwstring with german "öäü" is now ok

Regards



Ing. Anton Lerchster
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 04:28 PM
richard-service wrote:

Dear Antonio,

Please Look it.
I use New version Chinese input way, but not work
But I use Old version Chinese input way. It's working.

Please check your email, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 05:14 PM
Antonio Linares wrote:

Dear Antonio,

Please Look it.
I use New version Chinese input way, but not work
But I use Old version Chinese input way. It's working.

Please check your email, thanks

Ok. I got it. and Check solution it.

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: FWH 26.03 betatesters wanted
Posted: Thu Mar 26, 2026 06:47 PM

la compilación codicional para bcc32c de Borland es:

#if defined(BORLANDC) && defined(clang) && defined(WIN32) && !defined(WIN64)
// Your code.
#endif

y esta es para bcc64:

#if defined(BORLANDC) && defined(clang) && defined(_WIN64)
// Your code.
#endif

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)