From: flashlib on
No body help me?
From: chris.aseltine on
On Apr 13, 10:21 pm, flash...(a)gmail.com wrote:

> hDeviceHandle=CreateFile(
> szDevicePath[i],
> GENERIC_READ | GENERIC_WRITE,
> 0,//FILE_SHARE_READ | FILE_SHARE_WRITE,
> NULL,
> OPEN_EXISTING,
> FILE_FLAG_OVERLAPPED | FILE_ATTRIBUTE_NORMAL,
> NULL
> );
> ///////////////////////////////////////////////
> // it failed here, always return ERROR_FILE_NOT_FOUND
> ///////////////////////////////////////////////

For every case that you get ERROR_NOT_FILE_FOUND, give us a dump of
szDevicePath[i] please. My guess is that you've mangled it somehow.
From: flashlib on
On 4ÔÂ16ÈÕ, ÏÂÎç9ʱ26·Ö, chris.aselt...(a)gmail.com wrote:
> On Apr 13, 10:21 pm, flash...(a)gmail.com wrote:
>
> > hDeviceHandle=CreateFile(
> > szDevicePath[i],
> > GENERIC_READ | GENERIC_WRITE,
> > 0,//FILE_SHARE_READ | FILE_SHARE_WRITE,
> > NULL,
> > OPEN_EXISTING,
> > FILE_FLAG_OVERLAPPED | FILE_ATTRIBUTE_NORMAL,
> > NULL
> > );
> > ///////////////////////////////////////////////
> > // it failed here, always return ERROR_FILE_NOT_FOUND
> > ///////////////////////////////////////////////
>
> For every case that you get ERROR_NOT_FILE_FOUND, give us a dump of
> szDevicePath[i] please. My guess is that you've mangled it somehow.

Hi Chris,

Thanks for your attention! The szDevicePath[i] is as following:
"\\?
\usb#vid_abcd&pid_1234#5&25c045bb&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"

Thanks.
From: Ben Voigt [C++ MVP] on
flashlib(a)gmail.com wrote:
> On 4��16��, ����9ʱ26��, chris.aselt...(a)gmail.com wrote:
>> On Apr 13, 10:21 pm, flash...(a)gmail.com wrote:
>>
>>> hDeviceHandle=CreateFile(
>>> szDevicePath[i],
>>> GENERIC_READ | GENERIC_WRITE,
>>> 0,//FILE_SHARE_READ |
>>> FILE_SHARE_WRITE, NULL,
>>> OPEN_EXISTING,
>>> FILE_FLAG_OVERLAPPED |
>>> FILE_ATTRIBUTE_NORMAL, NULL
>>> );
>>>
>>>
>>>
>>> /////////////////////////////////////////////// // it failed here,
>>> always return ERROR_FILE_NOT_FOUND
>>> ///////////////////////////////////////////////
>>
>> For every case that you get ERROR_NOT_FILE_FOUND, give us a dump of
>> szDevicePath[i] please. My guess is that you've mangled it somehow.
>
> Hi Chris,
>
> Thanks for your attention! The szDevicePath[i] is as following:
> "\\?
> \usb#vid_abcd&pid_1234#5&25c045bb&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"

Check UNICODE vs single byte?

>
> Thanks.


From: flashlib on
On 4月17日, 下午11时02分, "Ben Voigt [C++ MVP]" <r...(a)nospam.nospam> wrote:
> flash...(a)gmail.com wrote:
> > On 4ÔÂ16ÈÕ, ÏÂÎç9ʱ26·Ö, chris.aselt...(a)gmail.com wrote:
> >> On Apr 13, 10:21 pm, flash...(a)gmail.com wrote:
>
> >>> hDeviceHandle=CreateFile(
> >>> szDevicePath[i],
> >>> GENERIC_READ | GENERIC_WRITE,
> >>> 0,//FILE_SHARE_READ |
> >>> FILE_SHARE_WRITE, NULL,
> >>> OPEN_EXISTING,
> >>> FILE_FLAG_OVERLAPPED |
> >>> FILE_ATTRIBUTE_NORMAL, NULL
> >>> );
>
> >>> /////////////////////////////////////////////// // it failed here,
> >>> always return ERROR_FILE_NOT_FOUND
> >>> ///////////////////////////////////////////////
>
> >> For every case that you get ERROR_NOT_FILE_FOUND, give us a dump of
> >> szDevicePath[i] please. My guess is that you've mangled it somehow.
>
> > Hi Chris,
>
> > Thanks for your attention! The szDevicePath[i] is as following:
> > "\\?
> > \usb#vid_abcd&pid_1234#5&25c045bb&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"
>
> Check UNICODE vs single byte?
>
>
>
> > Thanks.

Hi Ben,

I tried both Unicode and single byte, the result is the same. Any more
suggestion would be greate appreciated!