I have multi-tiered application that use OleVariant variables to send and receive data accross the line using custom communication framework. Usually the content of this OleVariant variable comes from TClientDataSet.Data (which, of course, is of OleVariant type). I have suspicion that the communication frmework changes the content of this OleVariant variable and therefore I would like to dump the contenct of the variable before sending and after receiving data. I use code:
TmpOrder: OleVariant;
Tmp: TStringList;
Tmp:=TStringList.Create;
try
Tmp.LoadFromFile('D: est.txt');
Tmp.Add('---');
Tmp.Add(TmpOrder);
Tmp.SaveToFile('D: est.txt');
finally
Tmp.Free;
end;
But the content of the file is meaningless. E.g., the following content of the file can represent the content of the TClientDataSet.Data:
---
??
Of course, there is something different happening.
So - how to capture the content of the OleVariant variable.
Saving TClientDataSet as XML is not option for me, because communication uses OleVariant not XML.
I am using Unciode Delphi (Delphi 2009 and up).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…