PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Troubles with CreateSurface after switching to 3.11

Hi Edge.

I need to load big amount of small files (about 70) and can not do that due to "access violation" exception that occurs in dsp->CreateSurface method in code for what there is no debug info. I've attached call stack screenshot to this post. Last known function name in list is ?HandleSurfList@ClassEDisplay@@AAA_NPAVE2DSurfaceBase@@_N@Z

I've edited Edgelib's Helloworld example to isolate error and to ease the process of finding it. I added following lines to ClassMain::OnDisplayInit()
Code:

for( int surface_index=0; surface_index<surfaces_count; surface_index++ )
{
int creation_result = ecd.dsp->CreateSurface( &surfaces[surface_index], "image1.png" );
if( creation_result != E_OK ) DebugBreak();
}

And to ClassMain's definition:
Code:

static const int surfaces_count = 200;
E2DSurface surfaces[surfaces_count];


* Very strange thing: when surfaces_count = 200 it fails on 30th image. And when, say, surfaces_count = 1900, exception occurs on loading to near 150th surface, so successfully loaded images count is growing.

* Freeing RAM on device seems has no effect on result. But if I try to load bigger files, the amount of successfully loaded is less.

* When I add this code to EdgeLib's 2.95 HelloWorld it can load 1000 of surfaces . And if I set to load for instance 3000 surfaces,windows low memory message will appear on device.

All these tests I've done using VS2005SP1 for PockecPC platform.
Hi Nomad,

Both EDGELIB version 3.10 and 3.11 have a bug where the application becomes instable when loading more than 32 surfaces. This bug has been fixed for version 3.20.

We've just released the 3.20 version which can be downloaded from clickgamer: http://www.clickgamer.com/download.htm?pvid=3356

Please let us know if this fixes your problem.
Yeah, building with EdgeLib 3.20 removes the problem.

And my custom Helloworld could load 1000 surfaces. I don't think I will need more :)

Great. Thanks