Last night I got out my Delphi books - you know, the decent ones that you got
when you purchased Delphi years ago.
Unfortunately, the downside of them was that the information is disbursed around
which  makes  following  them  sometimes  a bit tricky. So I am still stymied.

In the following example, can anyone see if it is in error, as there is no
memory allocation given, and may be the cause of some non-specific access
violation program errors that I was trying to fix. If wrong, example
appreciated.

type
  TPNodeData = ^TNodeData;
  TNodeData = record
    Index, Level, from, adds, subject, body: Integer;
    FullPath, UIDL: string;
  end;


function GetSpamLevel(from, adds, subject, body: string; Data: TPNodeData): Integer;




procedure Tmainform.VTree1InitNode(Sender: TBaseVirtualTree; ParentNode,
  Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
var Data: TPNodeData;
begin
//should I insert here: New(Data);
  with Sender do
  begin
    Data := GetNodeData(Node); //Pointer to Node data right?
    Data.Index := node.Index;  //no memory allocation here.
//Here is data being placed into the pointer 'Data.Level'
    Data.Level := GetSpamLevel(SakMsgList1.Items[Data.Index].From,
      SakMsgList1.Items[Data.Index].Subject, '', Data);
  end;
end;


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to