Knowledge Base Ask Cody Resources



 
Do you have any C++ sample code to illustrate how to send binary data?
Here it is:

//
// BEGIN SENDB.CPP
// This code segment ilustrates how to
// SEND binary data (structure) using
// the SendB Method.
//
{
struct tmp {
char command, phyline;
short projnum;
char uid[20];
} sud;

sud.command = 1;
sud.phyline = 0;
sud.projnum = 0;
strcpy (sud.uid, "supervisor");
long bytes = sizeof(sud);

VARIANT x;
x.parray = (SAFEARRAY *) calloc (1, sizeof (SAFEARRAY));
x.parray->pvData = &sud;
m_socket.SendB(x, bytes);
free (x.parray);
}
//
// END SENDB.CPP
//






12/27/2024   Legal notices | PRIVACY Policy |