Contents Previous Next Subchapters

Disconnecting an OMDDE Client From a Server

void OMClientDisconnect(int id)

This call terminates the connection specified by id where id is the integer value returned by a previous call to OMClientConnect .

The following program is in the file omclidis.c in the directory omwin\omdde. If you have the Microsoft Visual C++ compiler, it can be compiled and linked by executing the command
     nmake /f console.mak omclidis.exe
in that directory.

# include <stdio.h>
# include "define\omdde.h"
# include "define\noserver.h"

int main()
     int id;
     int ok;

     ok = OMDdeInitialize();
     if( ! ok )
     {    printf("Cannot initialize OMDDE\n");
          return 1;

     id = OMClientConnect("O-Matrix");
     {    printf("Cannot connect to O-Matrix\n");
          return 1;
     else printf("Can connect to O-Matrix\n");
     return 0;

Invalid memory will be accessed if id is not equal to a previous return value of OMClientConnect.