Contents Previous Next Subchapters

Connecting an OMDDE Client To a Server

int OMClientConnect(char *name)

This function call requests a connection with the current program as the client to a server specified by name. The argument name is a '\0' terminated character vector. A connection will be attempted to any program that called OMServerRegister with the same value for name. The default server name for O-Matrix is "O-Matrix". If the return value of OMClientConnect is greater than or equal zero, it is an integer that identifies this connection. If the return value is OMDDE_CONNECTION_FAILED, the connection failed.

The following program is in the file omclicon.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 omclicon.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("O-Matrix is not currently running\n");
     else printf("O-Matrix is currently running\n");

     return 0;