Hi i want to use create file to get a handle on my USB device so that i can stream from it. However i am having problems. To me i appear to have the syntax correct but i get errors returned in the form of

"Undefinded symbol HANDLE"
"statement is missing ;"

Can anyone see what im doing wrong here?
Thank you

HANDLE hRead = CreateFile(
("\\\\?\\F:"),
FILE_GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
0,
NULL);

ifstream f ("hread",std::ios::binary) ;

Recommended Answers

All 4 Replies

When you use win32-specific code, you have to know about the different windows API's specific symbol.

Maybe you forgot to include the right header file, at the beginning:

#include <windows.h>

Wow, long time no see Dieter.

I'm glad to see that you remembered of me :)
I'm happy to see you again, too

thanks that has got rid of one error now i seem to have developed another!

"could not find a match for ifstream::basic_ifstream"

Is it possible to stream directly from a device? or does it have to be implimented some other way?

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.