1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
void DDERequest(DWORD idInst, HCONV hConv, char* szItem, char* sDesc)
{
HSZ hszItem = DdeCreateStringHandle(idInst, szItem, 0);
HDDEDATA hData = DdeClientTransaction(NULL,0,hConv,hszItem,CF_TEXT, XTYP_REQUEST,5000, NULL);
DdeGetData(hData, (unsigned char *)szResult, 255, 0);
}
int main(int argc, char* argv[])
{
//DDE Initialization
//Start DDE Server and wait for it to become idle
//DDE Connect to Server using given AppName and topic.
for (int x=0; x<15000; x++)
{
DDERequest(idInst, hConv, szItem1, szDesc1);
//---do something with szResult
Sleep(100);
}
return 0;
}
|