Page 1 of 1
FWH - can't build Service with 2404 or 2407
Posted: Fri Aug 30, 2024 12:18 am
by TimStone
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.
Re: FWH - can't build Service with 2404 or 2407
Posted: Fri Aug 30, 2024 1:52 am
by nageswaragunupudi
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
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
#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.
Re: FWH - can't build Service with 2404 or 2407
Posted: Wed Sep 04, 2024 6:44 pm
by TimStone
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