Board index » delphi » "Invalid Pointer Operation" error solved

"Invalid Pointer Operation" error solved

I was having the error "Invalid Pointer Operation" error in a routine in my
Server Side application.
Debbuging the procedure, I discover that the exception occurs when the point
of the execution arrives at the "end;" line of the procedure.
After 10 days looking for the problem, I found it!

In the code, I have a dinamic array of a type defined by me. The problem was
that the fields sInicio e sFim of my structure are of the type String (that
is implicity a dinamic array too!).
To solve this I have just defined a size for the string fields; see the
code:

type
   InfoMatEtapa = record
        sInicio      : String;  // Changed to "sInicio : String[22]"
        sFim         : String;  // Changed to "sFim    : String[22]"
        iEtapa       : Integer;
        iQtFaltas    : Integer;
        iQtReforco   : Integer
        iQtReposicao : Integer;
    end;
var
    aInfoMatEtapas : array of InfoMatEtapa;

The error occured in the end of the procedure because is in this point that
the procedure destroys its local variables and Delphi seems doesn't know how
free that data.

I hope that this information help somebody, in the same way that this
newsgroup have helped me always I needed.

Thoughfully,

Gabriel Moreira
Delphi Developer - Brazil

 

Re:"Invalid Pointer Operation" error solved


Quote
Gabriel wrote:
> I was having the error "Invalid Pointer Operation" error in a routine
> in my Server Side application.

        I'm glad you solved the problem, but please note that cross-posting is
not allowed on Borland servers.  Please read and follow the newsgroup
guidelines at:

http://info.borland.com/newsgroups/guide.html

        Thank you,

        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase Perf. Monitor : http://delphi.weblogs.com/IBPerformanceMonitor
InterBase PLANalyzer 1.1: http://delphi.weblogs.com/IBPLANalyzer

Re:"Invalid Pointer Operation" error solved


"Gabriel" <gabrielspmore...@bol.com.br> escreveu na mensagem news:...
Quote
> I was having the error "Invalid Pointer Operation" error in a routine in
my
> Server Side application.
> Debbuging the procedure, I discover that the exception occurs when the
point
> of the execution arrives at the "end;" line of the procedure.
> After 10 days looking for the problem, I found it!

> In the code, I have a dinamic array of a type defined by me. The problem
was
> that the fields sInicio e sFim of my structure are of the type String
(that
> is implicity a dinamic array too!).
> To solve this I have just defined a size for the string fields; see the
> code:

> type
>    InfoMatEtapa = record
>         sInicio      : String;  // Changed to "sInicio : String[22]"
>         sFim         : String;  // Changed to "sFim    : String[22]"
>         iEtapa       : Integer;
>         iQtFaltas    : Integer;
>         iQtReforco   : Integer
>         iQtReposicao : Integer;
>     end;
> var
>     aInfoMatEtapas : array of InfoMatEtapa;

> The error occured in the end of the procedure because is in this point
that
> the procedure destroys its local variables and Delphi seems doesn't know
how
> free that data.

> I hope that this information help somebody, in the same way that this
> newsgroup have helped me always I needed.

> Thoughfully,

> Gabriel Moreira
> Delphi Developer - Brazil

Other Threads