|
前两天已经问了大家有关USB盘符访问的问题,在中文环境下也的确好了,但在英文情况下又出问题了。代码如下:
m_hUSBDevice = CreateFile(TEXT("\\硬盘\\1.txt"),
GENERIC_READ | GENERIC_WRITE,
0, NULL,
OPEN_EXISTING,
0, NULL);
if (m_hUSBDevice == INVALID_HANDLE_VALUE)
{
SENDERR((TEXT("Open USB Device failed...0x%x\r\n"),GetLastError()));
return 1;
}
else
{
SENDERR((TEXT("Open USB Device success!\r\n")));
};
上面的就是好的,打印打开success;
但在英文情况下,
m_hUSBDevice = CreateFile(TEXT("\\hard disk\\1.txt"),
//m_hUSBDevice = CreateFile(TEXT("\"\\hard disk\"\\1.txt"),
GENERIC_READ | GENERIC_WRITE,
0, NULL,
OPEN_EXISTING,
0, NULL);
if (m_hUSBDevice == INVALID_HANDLE_VALUE)
{
SENDERR((TEXT("Open USB Device failed...0x%x\r\n"),GetLastError()));
return 1;
}
else
{
SENDERR((TEXT("Open USB Device success!\r\n")));
};
怎么弄,都是打印Open USB Device failed...0x3 (ERROR_PATH_NOT_FOUND)
说明下,在reginit.ini文件里面,的确是hard disk,我的意思是说,我的名字是没有错误的,但不知道为什么都是报这样的错误,请问,在wince下,目录有空格该怎么访问啊?
谢谢
|
|