Page 1 of 3

Windows 7 / MSVS 2022 Crash

PostPosted: Wed Apr 05, 2023 6:01 pm
by TimStone
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.

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Wed Apr 05, 2023 6:43 pm
by Antonio Linares
Dear Tim,

Does it generate a log file ?

Does it report any info ?

thanks

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Wed Apr 05, 2023 6:55 pm
by TimStone
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.

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Wed Apr 05, 2023 7:13 pm
by Jimmy
hi Tim,

did you use Manifest :?:

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

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Wed Apr 05, 2023 8:24 pm
by karinha
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.

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Wed Apr 05, 2023 8:40 pm
by TimStone
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.

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Thu Apr 06, 2023 6:39 am
by Antonio Linares
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...

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Thu Apr 06, 2023 7:02 am
by Antonio Linares
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 :-)

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Thu Apr 06, 2023 7:07 am
by Antonio Linares
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

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Thu Apr 06, 2023 4:03 pm
by TimStone
I did a build with 2019 but my client never called so I could connect and test it.


Sent from my iPhone using Tapatalk

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Sun Apr 09, 2023 2:04 pm
by Giovany Vecchi
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.

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Sun Apr 09, 2023 9:37 pm
by Antonio Linares
Dear Giovany,

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

Can you explain it ? Thanks!

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Sun Apr 09, 2023 11:12 pm
by Giovany Vecchi
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.

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Mon Apr 10, 2023 7:36 am
by Enrico Maria Giordano
I confirm the problem and the solution.

Re: Windows 7 / MSVS 2022 Crash

PostPosted: Mon Apr 10, 2023 10:37 am
by Antonio Linares
It seems as this should be the right fix for it:
Code: Select all  Expand view
#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