function GetPluginCaption(Caption: PChar):Integer; stdcall; var s : string; begin //s := IniGSL(0, 'Lended CD''s'); s := 'Lended CD''s'; result := Length(s); if Caption <> nil then StrPCopy(Caption, s ); end; //////////// p : PChar; plen : integer; plen := GetPluginCaption(nil); GetMem(p, plen+1); GetPluginCaption(p); item.Caption := p; FreeMem(p, plen+1); sql : string; p : PChar; plen : integer; sql := 'SELECT ccd_id, ctitle, ccode FROM tcd WHERE ccd_id='+ IntToStr(integer(CdHistoryChooseCdListView.Selected.Data)); plen := length(sql); GetMem(p, plen+1); StrPCopy(p, sql); expADOQueryOpen(p, false); FreeMem(p, plen+1);