AMT2K5 wrote:
> Hello, I am trying to figure out the source of this unhandled exception
> (bad pointer or unallocated memory)
>
> I have a parent class, IOField with the following pointer to function
>
> bool (*isValid)(void *data, IOScreen *scrPtr);
>
> This holds the address of a function that is desinged to validate the
> data of an IOField after being edited. The IOField is displayed in an
> IOSCreen pointed by "scrPtr".
>
> Now later on in a child class, I want to make a function call to
> isValid;
>
> if(isValid(data,this->owner) == false) condition = true;
>
> Previous functions allocate memory for data and store strings in them,
> and this->owner is set in the constructor.
>
> data and, this->owner has an address but isValid does not.
>
> When compiling, the only address with 0x00000000 is isValid;
>
> Visual Studio 2005 reports,
> data 0x00129ac8 void *
> + owner 0x0012920c {fnum=15 row=2 col=5 ...}
> IOScreen *
> isValid 0x00000000 bool (void *, IOScreen *)*
> + this 0x00356b48 {flen=20 slen=40 curpos=0 ...}
> IOLineEdit * const
>
> Maybe I am doing something wrong with pointer to functions, I dont have
> *that* much experience using them (they are required in this college
> assignment).
>
> Appreciate any help and thanks in advance.
>
Have you initialized/assigned a value to `isValid'? (It sure looks like
you haven't.)
Show us the constructors for your class and we might be able to help.
HTH,
--ag
--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com (new post 8/5)
http://www.cafepress.com/goldsays
"If you have nothing to hide, you're not trying!"