"Hwnd of Zero is not valid" Issue

A client of mine recently updated their menu and added another 2 categories to their menu list.
Updated prices and all was well. Till it recently started hanging and taking forever to get onto the POS menu screen.
I thought it may have something to do with information overload or something.

Then i made a back up of the current database and decided execute clear database transactions to start from scratch.
Over 1 year period the database reached 1.3gb!
when i executed that in SambaPOS it basically froze and crashed.

so i removed it manually from SQL management and that took a while but it still did it finally.

Went back into sambapos, and pressed POS and this is the message i get below

Restarted SambaPOS and went back to POS screen. Same issue.
Very strange! any ideas?

Log Below

[General Info]

Application: SambaPOS
Version:     5.1.61
Region:      en
DB:          SQ
Machine:     KAIPOS-PC
User:        KAIPOS
Date:        2/12/2017
Time:        4:45 PM

User Explanation:

KAIPOS said ""

[Exception Info 1]

Top-level Exception
Type:        System.ComponentModel.Win32Exception
Message:     Invalid window handle
Source:      WindowsBase
Stack Trace: at MS.Win32.HwndWrapper.DestroyWindow(Object args)
   at MS.Win32.HwndWrapper.Dispose(Boolean disposing, Boolean isHwndBeingDestroyed)
   at MS.Win32.HwndWrapper.Dispose()
   at System.Windows.Interop.HwndSource.Dispose(Boolean disposing)
   at System.Windows.Interop.HwndSource.WeakEventDispatcherShutdown.OnShutdownFinished(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.Dispatcher.ShutdownImpl()
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()


[Assembly Info]

mscorlib, Version=
PresentationFramework, Version=
PresentationCore, Version=
System, Version=
WindowsBase, Version=
Samba.Services, Version=
System.ComponentModel.Composition, Version=
System.Configuration, Version=
System.Xaml, Version=
Microsoft.Practices.Prism.MefExtensions, Version=
Samba.Presentation.Services, Version=
Samba.Presentation.Common, Version=
Samba.Domain, Version=
Microsoft.Practices.Prism, Version=
System.Core, Version=
Samba.Infrastructure, Version=
DevExpress.Xpf.Core.v14.1, Version=
Microsoft.Practices.ServiceLocation, Version=
Samba.Localization, Version=
Samba.Persistance, Version=
FastButton, Version=


[System Info]

Operating System
-Microsoft Windows 7 Professional
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 480
--FreePhysicalMemory = 1455556
--OSArchitecture = 32-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

--Manufacturer = To be filled by O.E.M.
--Model = To be filled by O.E.M.
--TotalPhysicalMemory = 3661590528


######################### E N D #########################

UPDATE1 I thought it had something to do with insufficient memory so I manage to free some more memory from PC, restarted PC and went back to POS, it hanged for a bit, then it suddenly started working again… As if it wasn’t cached and it started caching, went back and forth a few times and it was ok.
Went back to main menu, selected other things such as accounts, reports, tickets, work periods then press POS again, and it started to hang again… Checked Task manage and definitely still has enough memory to process so im stumped right now…

Can you PM me database? It does if for cleaned database too right?

Define cleaned? You mean a database without any transactions but with a menu and products or a fresh new database without anything like starting from scratch.

Before I send you the database I’m going to try removing all, and reinstalling it with latest samba too and see If it makes a difference.

As I installed the backed up database on a different system and ran sambapos and it POS screen came on without any delay or error. Tested it numerous times and worked fine. So my guess it’s got something to do with their main system.

I think it’s the same cause as I was getting here, but the error log is different


I did notice the only time I was getting that error is if I use fast user switching. I also had a lot of tabs open in Chrome on the same system (I use a tab suspender plugin to free memory on inactive tabs) but it doesn’t appear to be related as I can leave SambaPOS open for all day while using the system, even locking it and going away, but if I leave the system and my wife signs in with her account (fast user switching) after a few hours if I go back to my account I got that error I mentioned on the linked post.

As I’ve explained on other topic both issues probably relates with graphic card driver. We have issues if graphic card software does not properly handle multi monitors, user switching or similar app window suspend / restore stuff. You can try -softrender switch. As it disable hardware rendering It may solve some issues.

1 Like