Click here to Skip to main content
15,919,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dbgheap line 1011 Pin
Neville Franks3-Nov-04 23:40
Neville Franks3-Nov-04 23:40 
GeneralFlex grid prblm Pin
balajeedurai3-Nov-04 21:58
balajeedurai3-Nov-04 21:58 
GeneralGet WMV Frame Rate Pin
ytod3-Nov-04 21:38
ytod3-Nov-04 21:38 
GeneralCreateFile, error Pin
gunnar663-Nov-04 21:33
gunnar663-Nov-04 21:33 
GeneralRe: CreateFile, error Pin
Cedric Moonen3-Nov-04 22:03
Cedric Moonen3-Nov-04 22:03 
GeneralRe: CreateFile, error Pin
gunnar663-Nov-04 23:02
gunnar663-Nov-04 23:02 
GeneralRe: CreateFile, error Pin
Cedric Moonen3-Nov-04 23:06
Cedric Moonen3-Nov-04 23:06 
GeneralRe: CreateFile, error Pin
jan larsen4-Nov-04 0:48
jan larsen4-Nov-04 0:48 
As I told you in another thread, there seems to be something fishy about the way your compiler handles the typedefs for TCHAR, PSTR, LPSTR and so on.

When you invoke CreateFile, you actually invoke either CreateFileA or CreateFileW based on whether UNICODE is defined or not.

Based on the error message, it seems that you are calling CreateFileW, which takes a unsigned short * as the filename parameter. This indicates that UNICODE is defined. I have no idea about what you mean when you mention "Emededd C++", but somewhere UNICODE is defined either explicit or implicit.

You have some considerations to do:
1. If you are sure that you only need to build for unicode, then you could start to use the proper functions explicit like this:
HANDLE hFile1;
unsigned short *filename1;
unsigned short *token;
unsigned short seps[] = L",";
unsigned short string[] = L"\\windows\\2004-10-T-gr1-tstTag1.csv,\\windows\\2004-10-T-gr1-tstTag2.csv";
token = wcstok( string, seps );
filnavn1 = token;
hFile1 = CreateFile (filnavn1, // Open .txt
GENERIC_READ, // Open for reading
0, // Do not share
NULL, // No security
OPEN_EXISTING, // Existing file only
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No template file


2. Or you could find out why your compiler insists on using the *W functions, but in the same breath refuses to translate TCHAR to unsigned short.

I would go for #2 Smile | :)

By the way, for runtime translation of string types: look up MultiByteToWideChar(), but as I said, you main problem is the confusion of string types.

"After all it's just text at the end of the day. - Colin Davies

"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
GeneralRe: CreateFile, error Pin
Antony M Kancidrowski4-Nov-04 1:13
Antony M Kancidrowski4-Nov-04 1:13 
GeneralRe: CreateFile, error Pin
jan larsen4-Nov-04 1:17
jan larsen4-Nov-04 1:17 
GeneralRe: CreateFile, error Pin
Antony M Kancidrowski4-Nov-04 2:05
Antony M Kancidrowski4-Nov-04 2:05 
GeneralRe: CreateFile, error Pin
jan larsen4-Nov-04 1:25
jan larsen4-Nov-04 1:25 
GeneralRe: CreateFile, error Pin
gunnar664-Nov-04 1:31
gunnar664-Nov-04 1:31 
GeneralHelp ! A strange problem Pin
poodle773-Nov-04 21:03
poodle773-Nov-04 21:03 
GeneralWindows groups and languages Pin
ramskar3-Nov-04 20:48
ramskar3-Nov-04 20:48 
GeneralRe: Windows groups and languages Pin
Antony M Kancidrowski4-Nov-04 0:32
Antony M Kancidrowski4-Nov-04 0:32 
GeneralRe: Windows groups and languages Pin
Blake Miller4-Nov-04 6:21
Blake Miller4-Nov-04 6:21 
GeneralRe: Windows groups and languages Pin
ramskar4-Nov-04 23:32
ramskar4-Nov-04 23:32 
GeneralRe: Windows groups and languages Pin
ramskar8-Nov-04 2:00
ramskar8-Nov-04 2:00 
QuestionGet ID of a Dialog? Pin
Anonymous3-Nov-04 20:45
Anonymous3-Nov-04 20:45 
AnswerRe: Get ID of a Dialog? Pin
ThatsAlok3-Nov-04 22:06
ThatsAlok3-Nov-04 22:06 
GeneralUpdating SDK Pin
cberam3-Nov-04 20:05
cberam3-Nov-04 20:05 
GeneralRe: Updating SDK Pin
Antony M Kancidrowski4-Nov-04 0:18
Antony M Kancidrowski4-Nov-04 0:18 
GeneralRe: Updating SDK Pin
David Crow4-Nov-04 3:49
David Crow4-Nov-04 3:49 
GeneralHelp me plase || CRichEdit Pin
TooLeeDiN3-Nov-04 17:11
TooLeeDiN3-Nov-04 17:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.