September 2011
Intermediate to advanced
744 pages
19h 4m
English
AN APPLICATION TO TEST IF A STREAM IS LOADED
The following code when implemented as the main( ) of a Compact 7 Console application tests if the stream MYD1: has been loaded. You can use it to test any stream loaded by changing the prefix used.
LPCTSTR wstream = _T("MYD1:");
HANDLE hStr = CreateFile(wstream, GENERIC_READ | GENERIC_WRITE, 0, NULL, NULL, 0);
if (hStr == (HANDLE)-1) {
RETAILMSG(1, (_T("BasicTestApp: Cannot open stream: %s"),wstream));
}
else
{
RETAILMSG(1, (_T("BasicTestApp: Opened stream: %s"),wstream));
}
Code snippet is from a console application to test if a Stream Driver has been loaded
Read now
Unlock full access