September 13th, 2010, 01:57 PM
Re: CreateFile Failed problem
What if the name is more than 16 characters? How are you going to stuff 10 pounds of potatos into a 5 pound bag?
Originally Posted by wklove2003
This effectively truncates that name to 15 characters.
strncpy(mDevice, aDevice, sizeof(mDevice) - 1);
That is the message you got back. Look at the name -- it should be much more than 15 characters. How much more? That's what string classes such as CString and std::string are for -- unlimited length strings.
CreateFile on \\.\C:\Documents an=failed with error code: 2"
Last edited by Paul McKenzie; September 13th, 2010 at 02:38 PM.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.