CreateFile returns ERROR_FILE_NOT_FOUND when using interface path

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello,<br/>I am encountering a problem when I try to connect to my webcam using CreateFile.<br/>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}<br/>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:<br/>
<pre lang=x-cpp>CreateFileA(detInfo->DevicePath,GENERIC_READ,FILE_SHARE_READ,0,CREATE_ALWAYS,FILE_FLAG_OVERLAPPED,0);[/code]
returned handle is invalid and GetLastError will return "2": ERROR_FILE_NOT_FOUND<br/><br/>Whats wrong?<br/>

View the full article
 
Back
Top