Running out of Windows Handles.

Running out of Windows Handles.

Postby byron.hopp » Wed Nov 02, 2022 5: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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Running out of Windows Handles.

Postby hmpaquito » Wed Nov 02, 2022 5:45 pm

Hi,

Use:

Code: Select all  Expand view
GetGdiObjects()
GetUserObjects()
GetGdiObjectsPeak()
GetUserObjectsPeak()
 

Regards
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Running out of Windows Handles.

Postby Antonio Linares » Wed Nov 02, 2022 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Running out of Windows Handles.

Postby byron.hopp » Wed Nov 02, 2022 9: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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Running out of Windows Handles.

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Running out of Windows Handles.

Postby Antonio Linares » Thu Nov 03, 2022 8:29 am

I fully agree with Mr. Rao
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Running out of Windows Handles.

Postby hmpaquito » Thu Nov 03, 2022 9:02 am

Code: Select all  Expand view
#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
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 95 guests