Member Avatar for Thew
Thew

Hello,
I am encountering a problem when I try to connect to my webcam using CreateFile.
Using the SetupApi, I found the interface path of my webcam: \\?\usb#vid_03f0&pid_5d11&mi_00#6&aad3e6&0&0000#{6bdd1fc6-810f-11d0-bec7-08002be2092f}
According to the MSDN documentation I supposed that when I use this interface path in CreateFile, I will be able to read from the webcam. But when I use:

CreateFileA(detInfo->DevicePath,GENERIC_READ,FILE_SHARE_READ,0,CREATE_ALWAYS,FILE_FLAG_OVERLAPPED,0);

GetLastError will return "2": ERROR_FILE_NOT_FOUND

What's wrong?