Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging Components - Tips Request

Status
Not open for further replies.

mattcs

Technical User
Jul 21, 2002
32
0
0
AU
Can anyone give me some tips on debugging a component during design time ?

I have a descendent of TLabel (TMyLabel) and have introduced one new property. At run time, I can set a value for the new property (eg - TMyabel->NewProperty = SomeValue) and get the result I want.

From this I understand that the Setter method I am using for the private data member associated with the property is working OK (to confirm this I stepped through with the runtime debugger).

In the object inspector, the new property shows up OK, however when I try to set a value, I get an "access violation at address" error.

The code looks like the following:

published:
__property AnsiString NewProperty = { read = FNewProperty, write = SetFNewProperty };

private:
AnsiString FNewProperty;
void __fastcall SetFNewProperty(AnsiString value);
. . . .
void __fastcall TMyLabel::SetFNewProperty(AnsiString value)
{
FNewProperty = value;
}

Any constructive comments / suggestions etc would be appreciated.
 
I have corrected the problem (but what the problem actually was I still don't know). The best I can think of is some sort of conflict within the IDE.

For those who may be interested, to fix the problem:

I removed the component from the pallete and the component's package lib from the design packages list. I deleted all files associated with the component and design package (except the component source files of course). I then re-installed the component into a new package and put that package back into the design packages list.

During the compile / link phase of the component (re)install I got several linker errors. I simpply did a rebuild and the errors didn't appear again ?? (and the package installed OK).

There may have been another less complicated solution but the clean restart worked for me. Fortunately, I am new to component building and only had one component in my package (on the pallete) that I was not prepared to lose if need be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top