Are you using CVI 6 ? I just tried the following, and had no problems with it:
#include
#include
#include
int main (int argc, char *argv[])
{
int f;
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
f = OpenFile("c:\\test .rdf", VAL_READ_WRITE,
VAL_OPEN_AS_IS,
VAL_BINARY);
if (f == -1) {
DebugPrintf( "ERROR: %s\n",
GetFmtIOErrorString(
GetFmtIOError()) );
}
else {
DebugPrintf( "Successfully opened the file\n" );
CloseFile(f);
}
return 0;
}
David McClelland
National Instruments