FWH - can't build Service with 2404 or 2407

FWH - can't build Service with 2404 or 2407

Postby TimStone » Fri Aug 30, 2024 12:18 am

I have a small app that runs as a service. I recently needed to update it, and found that I cannot build it with FWH 2404 or 2407. In both cases it errors out.

It appears the problem is that these versions require uxtheme.lib to be included. Of course a service is not going to use "windows" or its themes. In order to build it successfully, it is necessary to revert to 2402 ( or earlier ). Then I can eliminate uxtheme.lib and it builds, and runs, without a problem.

Is there a way to address this issue ?

Thanks.
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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: FWH - can't build Service with 2404 or 2407

Postby nageswaragunupudi » Fri Aug 30, 2024 1:52 am

It appears the problem is that these versions require uxtheme.lib to be included.

If you think that is the reason, please make these changes to "window.prg"

1) Please locate this line of code
Code: Select all  Expand view  RUN
  METHOD SetWindowTheme( cSub, cIds ) INLINE _SetWindowTheme( ::hWnd, cSub, cIds )

and comment it out,

2) Comment out this code at the end of window.prg":
Code: Select all  Expand view  RUN

#pragma BEGINDUMP

#include <windows.h>
#include <uxtheme.h>
#include <hbapi.h>
#include <fwh.h>

HB_FUNC_STATIC( _SETWINDOWTHEME )
{
   HRESULT h = SetWindowTheme( ( HWND ) fw_parH( 1 ), ( LPCWSTR ) fw_parWide( 2 ), ( LPCWSTR ) fw_parWide( 3 ) );
   hb_retl( h == S_OK );
}

#pragma ENDDUMP
 


Now, remove uxthemes.lib from your link script and try.
Please let us know if you are able to build services after these changes.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH - can't build Service with 2404 or 2407

Postby TimStone » Wed Sep 04, 2024 6:44 pm

I am very sorry for the delay in responding to your suggestion. I have been away from the computer for the past week +

Yes, by doing as you instructed, the program will build and operate successfully.

So, SetWindowsTheme is the problem when building a Service. In essence, we are not actually using a theme in a service since we do not display anything. The program runs strictly in the background and uses no graphics.

Tim
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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 23 guests