O'Reilly logo

Professional Windows® Embedded Compact 7 by Thierry Joubert, David Jones, Samuel Phung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

image
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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required