Re: unicode string
From: Ilya Manin (IlyaM_at_softspb.com)
Date: 08/23/04
- Next message: dule: "Re: SetWindowsHookEx"
- Previous message: Arsa: "Re: SetWindowsHookEx"
- In reply to: Nr 7: "unicode string"
- Next in thread: NR7: "Re: unicode string"
- Reply: NR7: "Re: unicode string"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 23 Aug 2004 13:26:13 +0400
You must to use "%s" flag (small 's') -
wsprintf(szFilename, _T("\\temp\\zenit-%s.asc"), knoopnummer);
Big 'S' get non unicode string (char*)
"Nr 7" <nrzeven@hotmail.com> wrote in message
news:df1b6527.0408230027.6d11df9f@posting.google.com...
> My program reads a file (containing one string). This string
> represents a filename.
>
> I want to create another file with this name.
>
> the code is :
>
> void SaveImage ()
> {
> TCHAR szFilename[255];
> wchar_t knoopnummer[255];
>
> GetKnoopnummerValue (knoopnummer); //reads the filename
> wsprintf(szFilename, _T("\\temp\\zenit-%S.asc"), knoopnummer);
> MessageBox(NULL,szFilename,TEXT("MESSAGE"),MB_OK);
>
> CreateFile(szFilename);
> }
>
> The strange thing is, that the message in the Messagebox is correct,
> but the filename is not correct when the new file is created. Only the
> first character is written.
>
> e.g. When the file contains 1234, the new file looks like 1.asc
> instead of 1234.asc.
>
> Any idea what is wrong?
- Next message: dule: "Re: SetWindowsHookEx"
- Previous message: Arsa: "Re: SetWindowsHookEx"
- In reply to: Nr 7: "unicode string"
- Next in thread: NR7: "Re: unicode string"
- Reply: NR7: "Re: unicode string"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|