FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Running out of Windows Handles.
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Running out of Windows Handles.
Posted: Wed Nov 02, 2022 05:07 PM

I got an error and my app just terminates with the following error message in the Error.log file:

System Error: The current process has used all of its system allowance of handles for Window Manager objects.

This is because of a TSay object (actually several, around 12). which are called from a timer in the program.

The program is basically like an arrivals display at an airport. I was creating the Say object without referencing a variable.

I changed it to create the say object with oSay01 through oSay12 and set them to nil every time they are called.

Still got the same error. Is there a way to recapture the handles so this stops happening?

Thanks,

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Running out of Windows Handles.
Posted: Wed Nov 02, 2022 05:45 PM
Hi,

Use:
Code (fw): Select all Collapse
GetGdiObjects()
GetUserObjects()
GetGdiObjectsPeak()
GetUserObjectsPeak()
Regards
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Running out of Windows Handles.
Posted: Wed Nov 02, 2022 09:34 PM

Dear Byron,

Don't create TSay objects. Use oWindow:Say( ... ) method for a window or dialog

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Running out of Windows Handles.
Posted: Wed Nov 02, 2022 09:44 PM

In Fivewin 21.11 I get link errors on each of the functions

Error: Unresolved external:

_HB_FUN_GetGdiObjects

_HB_FUN_GetUserObjects

_HB_FUN_GetGdiObjectsPeak

_HB_FUN_GetUserObjectsPeak

do I need a specific lib for these?

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Running out of Windows Handles.
Posted: Wed Nov 02, 2022 10:14 PM

Once you created the Say objects Say01 tp Say12, do not create them again, Keep setting new values to the same Says.

Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Running out of Windows Handles.
Posted: Thu Nov 03, 2022 08:29 AM

I fully agree with Mr. Rao

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Running out of Windows Handles.
Posted: Thu Nov 03, 2022 09:02 AM
Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <Windows.h>
#include <WinUser.h>


HB_FUNC( GETGDIOBJECTS )
{
   hb_retnd( GetGuiResources( GetCurrentProcess(), 0 ) );
}

HB_FUNC( GETGDIOBJECTSPEAK )
{
   hb_retnd( GetGuiResources( GetCurrentProcess(), 2 ) );
}

HB_FUNC( GETUSEROBJECTS )
{
   hb_retnd( GetGuiResources( GetCurrentProcess(), 1 ) );
}

HB_FUNC( GETUSEROBJECTSPEAK )
{
   hb_retnd( GetGuiResources( GetCurrentProcess(), 4 ) );
}

#pragma ENDDUMP

Continue the discussion