【发布时间】:2016-08-31 14:42:51
【问题描述】:
使用 XE8。 Devex TcxGrid 有一列表示带有 PopupEditProperties 和 PopupControl = 一个 TOleContainer 控件的 blob 数据。 该列代表各种数据类型(图像、pdf、word、excel、mpg、avi、mp3、ppt 等)的数据库字段(BlobType)
当来自 PopupEditProperties 的 OnInitPopup 事件触发时,我想这样做:
var
MS: TMemoryStream;
OC: TOleContainer;
begin
if not Query1.FieldByName('data').isNull then begin
OC := TcxPopupEditProperties(cxGrid1DBTableView1Data.Properties).PopupControl as TOleContainer;
//Size of Container
with OC do begin
Parent := TcxPopupEdit(Sender).PopupWindow;
Left := 5;
Top := 5;
Width := cxGrid1DBTableView1.Controller.FocusedColumn.Width;
Height := 300;
end;
MS := TMemoryStream.Create;
try
TBlobField(Query1.FieldByName('data')).SaveToStream(MS);
// I Want show the content with appropiate application
OC.LoadFromStream(MS); // here crashes
finally
MS.Free;
end;
end;
end;
引发了无效的流格式消息。 这样做的最佳问题是什么?
【问题讨论】:
标签: delphi devexpress media ole