PDA

View Full Version : mlGetCapabilities



jazzmaster
10-19-2003, 07:28 AM
Hi everybody!
I have a problem with this function... It returns 1000 after I call it and then when I call mlPvFind I get access violation. In the OpenML specification there is no 1000 status. What is wrong with my code?

void Init()
{
char *buf = new char[40];
MLstatus status;
MLpv *systemCap;
status = mlGetCapabilities( ML_SYSTEM_LOCALHOST, &systemCap);
MLpv* deviceIds = mlPvFind(systemCap, ML_SYSTEM_DEVICE_IDS_INT64_ARRAY);
if( deviceIds->length > 0 )
{
sprintf(buf, "%d", deviceIds->value.pInt64[0]);
MessageBox(NULL, "", buf, MB_OK);
}
mlFreeCapabilities( systemCap );
}

]\/[@d-Reindeer
10-19-2003, 10:20 AM
Please have a look at
ML/mldefs.h

and the enumeration "mlStatusReturnEnum"
around line 59.

fjaubert
10-21-2003, 04:06 AM
You could also use the function:
const char* mlStatusName( MLstatus status )

to get the "text" version of your error code.

That said, code 1000 is "internal error". I suppose that could mean a number of things, but most likely is that your ML daemon is not running. The daemon must be running in order for any ML program to work.