home *** CD-ROM | disk | FTP | other *** search
- #define INCL_OOL_WIN
- #include "ool.h"
-
- class View1Window: public XModelessDailog
- {
- public:
- void DoControl( XControlEvent * event);
- }
-
-
- View1Window :: View1Window( ): XModelessDialog( IDM_MAIN )//, "Sample8 - DDEServer", XFrameWindow::defaultDialogStyle | FRM_TASKLIST | FRM_CENTER, NULL, NULL, TRUE)
- {
- Show();
-
- SetText("DDEServer - not connected");
- dde = new MyDDE(this );
- Activate();
- }
-
-
- void View1Window :: DoControl( XControlEvent * event)
- {
-
- if( event->GetEventID() == WIN_KILLFOCUS)
- {
- char * item = NULL;
- switch( event->GetWindowID() )
- {
- case ENTRY_ONE:
- item = "FIELD1";
- break;
- case ENTRY_TWO:
- item = "FIELD2";
- break;
- case ENTRY_THREE:
- item = "FIELD3";
- break;
- case ENTRY_FOUR:
- item = "FIELD4";
- break;
- }
- if( item) //dde->IsConnected() &&
- {
- XString data;
- event->GetWindow()->GetText( &data );
- SHORT i;
- for(i=0; i < dde->clientCount; i++)
- {
- if( dde->clients[i] != 0)
- dde->SendData( dde->clients[i], item, (char*) data, data.GetLength() + 1, 0);
- }
- }
- }
- }
-
-
- void main ( void)
- {
- View1Window * window = new View1Window(); //create new framewindow (see above)
- XApplication::GetApplication()->Start(); //let the application work
- }
-