[Insight-users] SetDirectory For DICOM Reader..
Luis Ibanez
luis.ibanez at kitware.com
Sun, 29 Feb 2004 15:37:32 -0500
Hi Yasser,
In order to get a "char *" from a MFC CString
you can use the method GetBuffer();
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cstring.3a3a.getbuffer.asp
You can use it to construct a std::string and then
pass this std::string to the SetDirectory method.
It will look like:
CString directoryname;
std::string stringdirectory = directoryname.GetBuffer(200);
nameGenerator->SetDirectory( stringdirectory );
Regards,
Luis
---------------------------------------------------
yasser salman wrote:
>hi All..,
>
>when i setdirectory to Dicom files "/../Dicom" using
> nameGenerator->SetDirectory( "../../Dicom"); No
>problem occured..
>But if i read this Dicom Path from Dialog Box (with
>VC++) nameGenerator->SetDirectory( VolData_FName);
>This Error message occured.,
>"" Error C2664: 'SetDirectory' : cannot convert
>parameter 1 from 'class CString' to 'const class
>std::basic_string<char,struct
>std::char_traits<char>,class std::allocator<char> > &'
> Reason: cannot convert from 'class CString' to
>'const class std::basic_string<char,struct
>std::char_traits<char>,class std::allocator<char> >'
> No constructor could take the source type, or
>constructor overload resolution was ambiguous""
>
>I can't convert the type of VolData_FName coz i used
>it in allover my Vtk_ItkProject,, can any one help me
>to cross this problem..,
>Yasser..,
>
>
>
>__________________________________
>Do you Yahoo!?
>Get better spam protection with Yahoo! Mail.
>http://antispam.yahoo.com/tools
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
>