It's actually a out of memory error.Don't know if this will help but you could try this.
You can configure the heap size to be as high as 0x800000 by setting the following registry keys:
HKLM\SOFTWARE\Microsoft\Windows Messaging Subsystem
Value Name: SharedMemMaxSize
Value Type: REG_DWORD
Value Data: 0x800000
HKLM\SOFTWARE\Microsoft\Windows Messaging Subsystem\Applications\<MyApp>\SharedMemMaxSize
Value Name: SharedMemMaxSize
Value Type: REG_DWORD
Value Data: 0x800000
In this scenario, <MyApp> is the name of your application (without the .exe extension). For example, if your application is Mad.exe, enter MAD for the <MyApp> value.