That error seems to happen if the BlueStacks registry settings for its window size somehow got changed to an invalid value like 0 or -1, possibly due to a bug with BlueStacks. You must edit the following registry values (the window resolution of BlueStacks) to valid values using the Registry Editor (regedit.exe):
Or (easier) use the following registry file (copy the following text in code markup and save it to a .REG file using a text editor):
Windows Registry Editor Version 5.00
; Fix for BlueStacks errors: http://superuser.com/a/1078513/10259?bluestacks-giving-me-an-object-reference-error
[HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0]
"WindowWidth"=dword:00000500
"WindowHeight"=dword:000002d0
This registry file sets the size of the BlueStacks window to 1280 × 720. I made it as the error regularly happens to my copy of BlueStacks. Just open up the resulting .REG file and allow the Registry Editor to make the changes. Aside from the 'Object reference not set to instance of an object' error, this should also help fix the following errors:
- Error: parameter is not valid
- Error: InvalidArgument=Value of '-1' is not valid for 'index'. Parameter name: index
- Error: Rectangle '{X=0,Y=0/Width=60,Height=0}' cannot have a width or height equal to 0.
- Error: Specified argument was out of the range of valid values. Parameter name: MinimumSize