[Insight-users] Image reader problem

Niels Dekker niels-xtk at xs4all.nl
Mon May 5 13:35:27 EDT 2008


Charles Knox wrote:
>>  reader->SetFileName( (LPCTSTR)csFileName);


AFAIK, SetFileName has (const char *) as argument, which /may/ not be 
the same as LPCTSTR. LPCTSTR is defined as const TCHAR pointer, where 
TCHAR may be either char or WCHAR, depending on some compiler setting.

If you really need the cast (LPCTSTR)?  Or would it also compile without 
the cast?  As follows:

  reader->SetFileName(csFileName);

If it doesn't compile, can you do it in two steps?

  const char * const pointerToChar = csFileName;  // 1.
  reader->SetFileName(pointerToChar);  // 2.

BTW, does (or will) ITK support Unicode filenames?


Kind regards,
-- 
Niels Dekker
http://www.xs4all.nl/~nd/dekkerware
Scientific programmer at LKEB, Leiden University Medical Center 



More information about the Insight-users mailing list