Hi, I am a research student using origin as my graphing software.I use DDE to exchange data between my application and Origin in "real time".My MFC application is the DDE server and the code for intializing it goes like this
void timersettingsDlg::OnViewPlots() { DWORD g_idInst;
HSZ hszService;
char ServerBuf[MAX_COMPUTERNAME_LENGTH+8];
wsprintf( ServerBuf,"TRIC_DDE_SERVER");
ShellExecute(NULL, "open","\"E:\\Documents and Settings\\Adminastraitor\\Desktop\\NEW TRIC\\TTRIC\\Origintric.OPJ\"", NULL, NULL, SW_SHOWNORMAL);
// Register the server application. if( DdeInitialize( &g_idInst, (PFNCALLBACK) DdeCallback, APPCLASS_STANDARD | CBF_FAIL_SELFCONNECTIONS | CBF_FAIL_REQUESTS | CBF_FAIL_EXECUTES, 0L ) == DMLERR_NO_ERROR ) AfxMessageBox("Hello");
hszService = DdeCreateStringHandle( g_idInst, ServerBuf, 0 );
DdeNameService( g_idInst,hszService,0L,DNS_REGISTER); } and the callback function for my MFC server goes like
HDDEDATA CALLBACK DdeCallback( UINT iType, UINT iFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2 ) { MessageBeep(MB_ICONHAND); AfxMessageBox("Hello"); return (HDDEDATA) TRUE; } I hope everthing is fine till now. I tried to connect to this server from a client , Origin in my case and I used Labtalk for the same. The code goes like dde -c TRIC_DDE_SERVER|data id; If my code works properly or if my programing is right , I must get a message box with "Hello", which I dont. I am completely new tothis labtalk script and so can anyone help me out.
Thanks, Deepak Samuel.
|