The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 DDE help required
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cosy

Germany
Posts

Posted - 02/23/2004 :  11:42:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.



  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000