Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Передача данных между TClientDataSet разных приложений через стандартны

11 views
Skip to first unread message

Dmytry Ginzburg

unread,
Sep 12, 2009, 4:55:30 PM9/12/09
to
������������, � ���������������(��), All!
���.. H���� ��������.. � ���, ��� �� ����� �����:

������� ���� ������� �����. �������� ��������� ��������. � ����� � ���, ���
���� COM ������ �� ���������� � ADO (��� ������ ��������, ������������
RecordSet ������������ � AV � ntdll.dll � ������ �����������, ��������� � COM,
����� ������������� ��������������� �������) ������� ������� �������� ���������
� �� � ������ � COM �������� �� ������ �������� �������������. �� ��������,
���������� ����, COM ��� ������ ������������ �� ����. ������� �����
������������ ����� ��� ������ ����� ������������. � ������� ���������
���������� ���������� ��� ������ � �� �� C++ Builder, � ����� ��������
��������� ���������� �� �������.
_!--==> � ���� Windows Clipboard ����������... <==--!_
int main(int argc, char* argv[])
{AnsiString s="Begin of main";
OutputDebugString(s.c_str());
char c[65535];
char c2;
int t=1;
if(IsDebuggerPresent())s="I'm under debugger";else s="I am not under debugger";
OutputDebugString(s.c_str());
try{try{CoInitialize(0);
s="I've executed CoInititalize";
OutputDebugString(s.c_str());
DataModule2=new TDataModule2(0);
s="I've created DataModule2";
OutputDebugString(s.c_str());
if(!gets(c))s="I haven't got any string because of error";else{
s=c;
s="I've got connection string. It's "+s;}
OutputDebugString(s.c_str());
DataModule2->ADOQuery1->ConnectionString=c;
s="I've put connection string to ADOQuery";
OutputDebugString(s.c_str());
if(!gets(c)){s=errno;s="I haven't got any string because of error"+s;}else{
s=c;
s="I've got query for database. It's "+s;}
OutputDebugString(s.c_str());
DataModule2->ADOQuery1->SQL->Add(c);
s="I've put my query to ADOQuery";
OutputDebugString(s.c_str());
DataModule2->ADOQuery1->Open();
DataModule2->ClientDataSet1->Open();
s="I've executed query";
OutputDebugString(s.c_str());
t=DataModule2->ClientDataSet1->DataSize;
s=t;
s="DataSize is "+s;
OutputDebugString(s.c_str());
s="I've put DataSize to cout";
OutputDebugString(s.c_str());
DataModule2->ClientDataSet1->SaveToStream(str,dfXML);
t=str->Size;
char *p=(char *)&t;
//for(int i=0;i<4;cout<<*p,p++,i++);
s=str->Size;
s="I've saved query result to stream It has size "+s;
//gets(&c2);
OutputDebugString(s.c_str());
char *c1=(char *)str->Memory;
s="I've got the stream's address";
OutputDebugString(s.c_str());
//cout<<str->Size<<'\n';
for(int i=0;i<str->Size;cout<<*c1,c1++,i++);
s="I've sent stream to cout";
OutputDebugString(s.c_str());
}
__finally{
if(DataModule2)DataModule2->Free();
if(str)str->Free();
CoUninitialize();
}}
catch(Exception *e){OutputDebugString(e->Message.c_str());
cout<<e->Message.c_str();}
return 0;
}
_!--==> � ���� Windows Clipboard �������������... <==--!_
� ������������ ����������� ������ �����/������ �� ��� ����� � �ӣ ������
��������. H� ���� ���� ��������. ����� � �������� �� ����� �����������������
dataset, �� ��� ������� ��� ���������� � dataSet � ��������� ��������� ������
Data Mismatch. � ���ۣ��� ���������� � �����, ��� ������ ����� �����������
����� �����/������ ����������� ���������� ������ ���������� ��������. � ����� �
���� � ���� ��������� ������, ��� ��������� �������� ������ ���������� ��������
�� ����� ��������� � ������ ����� ����������� ����� ��� �������� ��� ��� �
������ ���������. ������, ������ �������� � ��������� � �������� � ������
����������, ��� � ��������. ��� ������� ���, ����� ��������� ��������� �������
�� ����� ��������� � ������?

����� ��� ����� ����������, All.�������.

0 new messages