Error Creating Window Handle

Brain-BulbIt starts with “Can not create Window Handle”… and continuous random crashes. You find out your app reaches the max of 10000 user objects. (Just check the task manager, you’ll see I’m right.)

So, you’ve been using your own usercontrols on a flowlayoutpanel; you add, you remove, you clear… however the user objects count keeps growing and something is leaking somewhere…

You find that .controls.clear() does not work, you have to dispose() of all the objects first. Okay, do that, but it still doesn’t work.
So what’s the trick?
Simply remove first, before the dispose, and do this one at a time.

Just use the following routine:
ClearFlowLayoutPanel(myFlowLayoutPanel)
instead of
myFlowLayoutPanel.Controls.Clear()

Public Sub ClearFlowLayoutPanel(cFlowLayoutPanel As FlowLayoutPanel)
 Do While (cFlowLayoutPanel.Controls.Count > 0)
  Using controltoremove = cFlowLayoutPanel.Controls(0)
   cFlowLayoutPanel.Controls.Remove(controltoremove)
   controltoremove.Dispose()
  End Using
 Loop
 GC.Collect()
 GC.WaitForPendingFinalizers()
 cFlowLayoutPanel.Controls.Clear()
End Sub

Good Luck! …or ask My Brain.

sources or more info:
https://blogs.technet.microsoft.com/markrussinovich/2010/02/24/pushing-the-limits-of-windows-user-and-gdi-objects-part-1/
http://stackoverflow.com/questions/1378668/clearing-controls-from-flowlayoutpanel-not-calling-destructors/

 

Windows 10 Home Add local users disabled?

W10disketteIf you cannot add users to Windows 10, or if ‘Add someone else to this PC’ link in Settings app is not working, then this article will help you to fix that.

This article address a problem in which administrators can’t add new users to Windows. For adding new users or other family members to the system, you’ve to go Settings app > Accounts > Family and other users and then click Add someone else to this PC link. However, we’ve found that many administrators got this link not working. According to them, when they click the link, nothing happens. It’s disabled.

The cause behind this problem may be miscellaneous, depending upon your system usage and availability of crucial factors such as network, dependency services etc. If you’re also victim of this issue, you can try out the ways mentioned below to overcome this.

FIX : Cannot Add Users To Windows 10 – Using NETPLWIZ

1. Press Windows Key + R and put netplwiz in Run dialog box. Click OK or hit Enter key.

2. In the User Accounts window so appeared, click Add button.

3. Then in next screen, type the Microsoft account email address of the person – whom you want to add. The account created by this way will be Microsoft account. So if you want to add new user with Local account, click Sign in without a Microsoft account (not recommended) link.

4. In the next screen, click Local account. If your decision is changed after reading benefits of Microsoft account, you can opt for Microsoft account.

5. Finally, on the next screen as per what you’ve chosen above, you can add the user to the machine by providing required details.

Note by My Brain: to add another user, close the netplwiz completely and start again from 1.

SOURCE: here

USB not connecting with your smartphone?

W10disketteWhen I connect my phone (Galaxy s5 mini, usb mode set to ‘Camera PTP’) to my Windows 10 laptop, the usb port constantly disconnects and reconnects rapidly and not a lot is happening. I can’t access the phone in device manager since it constantly refreshes.

You might think  it’s a driver problem, or a problem with the cable…. But no! Try this solution:
1. Go to your Windows ‘Power Options’
2. Click ‘Change plan setting’ on your chosen plan.
3. Click ‘Change advanced power setting’ on your chosen plan.
4. Find ‘USB settings’ and open.
5. Find ‘USB selective suspend setting’ and change it to disabled.
Now apply and save and, tadaa…

This is working for me, besides having tried three different cables to find one that does more than just charging… (Note: when you use Samsung’s Kies software, use the Media Player usb mode MTP)
I hope this helps when you have a similar problem.