This site is no longer active and is available for archival purposes only. Registration and login is disabled.

What is wrong with this piece of code?


What is wrong with this piece of code?

Postby efortier » Apr 21, 2002 @ 7:25am

efortier
 


Postby Johan » Apr 21, 2002 @ 5:23pm

Hi,

The issues are in you C++ code. You should not delete objects which are instantiated on the stack.

So. Just remove the following rows and the code should work correctly:

// Remove these lines:
delete &gd_S1;
delete &gd_Backbuffer;
delete &gd_Display;
// End of line removal

Best regards,
Johan
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


re: What is wrong with this piece of code? -- New try

Postby efortier » Apr 21, 2002 @ 9:30pm

Hello, and thanks for your reply!

I tried what you mentionned and it still doesn't work. So I created a new PocketPC 2002 project, and added only these lines to a menu message handler:

case ID_mnuGapiDraw:
{
HRESULT cRes = GD_OK;
CGapiDisplay gd_Display;
cRes = gd_Display.OpenDisplay(hWnd, GDOPENDISPLAY_FULLSCREEN );
if(cRes != GD_OK)
{
ShowErr(1,cRes,hWnd);
break;
}
cRes = gd_Display.SetDisplayMode(GDDISPMODE_NORMAL);
if(cRes != GD_OK)
{
ShowErr(2,cRes,hWnd);
break;
}
break;
}

On the first try, all works correctly. The second time I click on the menu, the SetDisplayMode return the PRIMARYSURFACEALREADYEXISTS error message.

Are there any restrictions to when and where GapiDraw should be used?

There's so little code that I don't know what I'm doing wrong. My PC runs Windows 2000 with the eVC distribution, and my portable is an iPAQ 3850 with no add-ons.

Thanks for any other infos. Sorry for the lack of tabs or spaces. The forums removed them...
efortier
 


Postby Johan » Apr 28, 2002 @ 5:35pm

User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron