FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Windows 7 / MSVS 2022 Crash
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Windows 7 / MSVS 2022 Crash
Posted: Wed Apr 05, 2023 06:01 PM

I have an application that runs perfectly in Windows 8-11. However, it crashes on startup under Windows 7.

I am using the latest FWH, plus Microsoft Visual Studio 2022 Community, and Harbour.

This occurs in both 32 bit and 64 bit.

I am comparing any changes in the program that might account for this. Any thoughts on where to look ? Any suggestions are appreciated.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Wed Apr 05, 2023 06:43 PM

Dear Tim,

Does it generate a log file ?

Does it report any info ?

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Wed Apr 05, 2023 06:55 PM

Not really. Windows crashes it.

Other apps built with the same link script work fine. I'm thinking it may have to do with a newer set of features we use in the current builds of FWH/Harbour that are not supported in Win 7.

I'm not sympathetic since most Win 7 installs came with a free upgrade to Win 8 which was then free to upgrade to Win 10 / 11.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Windows 7 / MSVS 2022 Crash
Posted: Wed Apr 05, 2023 07:13 PM
hi Tim,

did you use Manifest :?:

there might be some Setting which Windows 7 don´t know
greeting,

Jimmy
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Wed Apr 05, 2023 08:24 PM
TimStone wrote:Not really. Windows crashes it.

Other apps built with the same link script work fine. I'm thinking it may have to do with a newer set of features we use in the current builds of FWH/Harbour that are not supported in Win 7.

I'm not sympathetic since most Win 7 installs came with a free upgrade to Win 8 which was then free to upgrade to Win 10 / 11.
???????????

What new feature set do we use in current FWH/Harbour builds? Do you have any executables for me to test on my Windows 7?

¿Qué nuevo conjunto de características usamos en las versiones actuales de FWH/Harbour? ¿Tiene algún ejecutable para probar en mi Windows 7?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Wed Apr 05, 2023 08:40 PM

Jimmy,

I did have a Manifest, but yesterday I found it created major problems with a Dell Super Hi-Res Monitor that was running 3840x2160. It was very strange. Removing the manifest solved that problem. However it did not solve the problem running on Windows 7.

Karinha,

We have actually added many new capabilities into FWH. I first noticed the problem with a late VS 2019 update, and consistently with 2022.

My exe is far too large, and requires registered file, to send you one for testing. Thanks for the offer.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Thu Apr 06, 2023 06:39 AM

Dear Tim,

Do you use Total Commander ? If possible doble click your EXE from Total Commander. If there is a missing DLL it will let you know it.

I am installing VirtualBox and Win7 to test it...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Thu Apr 06, 2023 07:02 AM
Dear Tim,

I just built FWH\samples\fivedbu.exe and executed it from (virtualbox) Windows 7 and it properly worked.

If you could install Visual Studio in such Windows 7 machine, running your EXE from the Visual Studio IDE will surely tell you whats the problem

I use this technique to get some info when no info is found and it works really well :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Thu Apr 06, 2023 07:07 AM
I just tried to run te VisualStudioSetup.exe from Win7 and it also fails :-)

So I guess we need to find one Visual Studio that works on Win7...

chatGPT just told me to use the Visual Studio 2019 version
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Thu Apr 06, 2023 04:03 PM

I did a build with 2019 but my client never called so I could connect and test it.

Sent from my iPhone using Tapatalk

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 244
Joined: Mon Jun 05, 2006 09:39 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Sun Apr 09, 2023 02:04 PM

The only problem I had compiling with MSVC on Windows 7 I solved it by including the "profile.c" module.

Compile and test on windows 7.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Sun Apr 09, 2023 09:37 PM

Dear Giovany,

Do you mean the FWH "profile.c" file ? It is already included in FWH.

Can you explain it ? Thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 244
Joined: Mon Jun 05, 2006 09:39 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Sun Apr 09, 2023 11:12 PM

Yes, it's Fivewin's sources\winapi\profile.c.

I don't know why this happens. Compiling with MSVC 2022 the program caused GPF in the windows 7 system. In the 'GETPROFSTRING' function.

With the memory stack address of the GPF number I looked in my .MAP file generated by the MSVC compiler and it corresponded to this function.

It just included it so that it could be compiled again in the program and the problem no longer occurred.

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Mon Apr 10, 2023 07:36 AM

I confirm the problem and the solution.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 7 / MSVS 2022 Crash
Posted: Mon Apr 10, 2023 10:37 AM
It seems as this should be the right fix for it:
Code (fw): Select all Collapse
#ifdef __HARBOUR__
   HB_FUNC( GETPROFSTRING )
#else
   HB_FUNC( GETPROFSTR )
#endif
{
   #define BUFSIZE  16384
   BYTE * bBuffer = hb_xgrab( BUFSIZE );
   WORD wLen = GetProfileString( hb_parc( 1 ),   // Section
                                 IF( HB_ISCHAR( 2 ), hb_parc( 2 ), 0 ),   // Entry
                                 hb_parc( 3 ),   // Default
                                 ( char * ) bBuffer,      // Destination Buffer
                                 BUFSIZE - 1 );
   if( wLen )
      hb_retclen( ( char * ) bBuffer, wLen );
   else
      hb_retc( "" );

   hb_xfree( bBuffer );   
}
I appreciate it if you test it and let me know your results, many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com