VoyForums

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 123[4]5678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 18:55:38 12/27/02 Fri
Author: Héctor
Subject: EOutOfResources error C++ Builder 5

Hi, I'm working in an application for create a tool that helps to make chess exercises. At the moment I've created an application that allows you to create an initial configuration for the chessboard. When the application starts, the chessboard is drawn and the pieces too -the 32- and you can put'em where you want. The problem is that when you try to move all the pieces on the board, I get an "EOutOfResources" error. I know this error occurs usually when you don't free resources but, I don't create any new resources during the application. If at the starts there's no problem I don't understand why there is when I'm dragging the pieces....This is a part of the source code:

Piece _pieces[32];
Piece *dragged;
OnMouseDown-->
dragged = NULL;
for (i=0;i<32;i++)
if _pieces[i]->contains(x,y)
dragged = pieces[i];
OnMouseMOve-->
if (dragged!=NUlL) dragged->move(x,y)
OnMOuseUP-->
dragged =NULL

I found the problem is in the procedure move(x,y) of the class Piece:
where there is property TImage* _image;
_image->Left = _x = x-(ancho/2);
_image->Top = _y = y-(alto/2);
********_image->Refresh();*******I THINK HERE IS THE PROBLEM!!!!!

if I call the dragged->move(x,y) ONMOuseUp and not on ONMouseMove, there's no problem.........WHY THIS HAPPENS??!!!??
thanks

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.