Which version of ReportBuilder are you using? I tried your exact code below with RB 7.03 and it seemed to work correctly. As a test try disabling all your event handlers and seeing if it works then. Next try downloading a trial copy of RB 7.03 and testing with that. If you still cannot get it working, please send a small example demonstrating the AV to support@digital-metaphors.com and I'll take a look.
Compiled with you source... When I get error the following unit/code comes up:
procedure TppCustomReport.SendDesignMessage(aMsg: Cardinal; aWParam: Word; aLParam: Longint); begin
if (MainReport <> nil) then if MainReport.Printing then Exit;
if (FReportDesigner <> nil) then FReportDesigner.Perform(aMsg, aWParam, aLParam); // <------- ERROR HERE
end; {procedure, SendDesignMessage}
If I step line by line the error seems to happen in the line marked above. The AV occurs the second time this proc is executed after the Close button is clicked for the designer.
Stepping further into the code, the AV occurs in :
procedure TppTreeBuilder.RemoveComponent(aComponent: TComponent); var lComponentNode: TTreeNode; lChildNode: TTreeNode; liIndex: Integer;
begin
if not TreeView.FindComponentNode(aComponent, lComponentNode) then Exit;
{remove child node component} for liIndex := lComponentNode.Count-1 downto 0 do <<--------------- AV HERE begin lChildNode := lComponentNode.Item[liIndex];
if (TObject(lChildNode.Data) is TComponent) then TreeView.RemoveComponent(TComponent(lChildNode.Data)); end;
A small example demonstrating this behavior would be very helpful. Please send it in .zip format to support@digital-metaphors.com and I'll take a look.
Comments
with RB 7.03 and it seemed to work correctly. As a test try disabling all
your event handlers and seeing if it works then. Next try downloading a
trial copy of RB 7.03 and testing with that. If you still cannot get it
working, please send a small example demonstrating the AV to
support@digital-metaphors.com and I'll take a look.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
up:
procedure TppCustomReport.SendDesignMessage(aMsg: Cardinal; aWParam: Word;
aLParam: Longint);
begin
if (MainReport <> nil) then
if MainReport.Printing then Exit;
if (FReportDesigner <> nil) then
FReportDesigner.Perform(aMsg, aWParam, aLParam); // <------- ERROR
HERE
end; {procedure, SendDesignMessage}
If I step line by line the error seems to happen in the line marked above.
The AV occurs the second time this proc is executed after the Close button
is clicked for the designer.
procedure TppTreeBuilder.RemoveComponent(aComponent: TComponent);
var
lComponentNode: TTreeNode;
lChildNode: TTreeNode;
liIndex: Integer;
begin
if not TreeView.FindComponentNode(aComponent, lComponentNode) then Exit;
{remove child node component}
for liIndex := lComponentNode.Count-1 downto 0 do <<--------------- AV
HERE
begin
lChildNode := lComponentNode.Item[liIndex];
if (TObject(lChildNode.Data) is TComponent) then
TreeView.RemoveComponent(TComponent(lChildNode.Data));
end;
{update internal component lists}
liIndex := FComponents.Remove(aComponent);
Should I try to create a small sample app that demonstrates the problem or
is this one you're aware of?
send it in .zip format to support@digital-metaphors.com and I'll take a
look.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com