|
Contents | Previous | Next | Subchapters |
char *OMClientPutMat(
int id,
enum type_mat mtype,
int nr,
int nc,
void *data
)
LOGICAL_mat,INT_mat,REAL_mat,DOUBLE_mat,COMPLEX_mat,CHAR_mat.
The argument nr is an integer specifying the number of
rows in the matrix.
The argument nc is an integer specifying the number of
columns in the matrix.
The argument data is a pointer to the data in the matrix.
This data must be in column major order; i.e., the first column
followed by the second etc.
If the return value is equal to "ok", the matrix was accepted.
If the return value is equal to "busy",
the server is currently busy and cannot accept the matrix.
/ 1 3 \
\ 2 4 /
in the Command window of a currently running copy of O-Matrix.
It is in the file omcliput.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 omcliput.exe
in that directory.
# include <stdio.h>
# include "define\omdde.h"
# include "define\noserver.h"
int main()
{
int id;
char *msg;
enum type_mat mtype = DOUBLE_mat;
int nr = 2;
int nc = 2;
mdbl data[] = {1., 2., 3., 4.};
char *cmd = "print omlink(\"get\")";
int ok;
ok = OMDdeInitialize();
if( ! ok )
{ printf("Cannot initialize OMDDE\n");
return 1;
}
id = OMClientConnect("O-Matrix");
if( id == OMDDE_CONNECTION_FAILED )
{ printf("Cannot connect to O-Matrix\n");
return 1;
}
msg = OMClientPutMat(id, mtype, nr, nc, data);
printf("Matrix transfer result = %s\n", msg);
msg = OMClientPutCmd(id, cmd);
printf("Command transfer result = %s\n", msg);
OMDdeUninitialize();
return 0;
}
OMClientConnect.