Topic: C++ Builder DDE Dynamic Data Exchange
I'm trying to get instantaneous data from a software (ion enterprise) with DDE. In excel the command:
=ion_link|GROUPADI.CIHAZADI!'0x5800'
succeeds but when I use the same server, topic and item names as below; the onChange event handler "DdeClientItem1Change" is not triggered. Even when it triggers when the connection establihed; I cannot find any data in DdeClientItem1->Text . The simple (and not working) client code is below.
Thank you
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if(DdeClientConv1->SetLink("ion_link","GROUPADI.CIHAZADI"))
{
Application->MessageBox("DDE Link Successful!","DDE Information",MB_OK);
DdeClientItem1->DdeItem = "0x5800";
}
else
{
MessageBox(Handle,"DDE Link Unsuccessful","DDE Information",MB_OK|
MB_ICONERROR);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DdeClientItem1Change(TObject *Sender)
{
Edit1->Text = DdeClientItem1->Text;
Application->MessageBox("Change Occurred!","DDE Information",MB_OK);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
DdeClientConv1->OpenLink();
DdeClientItem1->Text = DdeClientConv1->RequestData(DdeClientItem1->DdeItem);
}
//---------------------------------------------------------------------------