J
John E Katich
How can I cast a String to a const wchar_t*?
Ths following code genreates a compile error:
error C2664: '_wsplitpath' : cannot convert parameter 1 from 'System::String
__gc *' to 'const wchar_t *'
OpenFileDialog* ofd = new OpenFileDialog();
ofd->Filter = "OW Files|*.db;aepctl.dat;aepord.dat;aep|All Files|*.*";
if(ofd->ShowDialog() == DialogResult::OK)
{
wchar_t drive[_MAX_DRIVE];
wchar_t dir[_MAX_DIR];
wchar_t fname[_MAX_FNAME];
_wsplitpath( ofd->FileName ,drive,dir,fname,NULL);
}
Ths following code genreates a compile error:
error C2664: '_wsplitpath' : cannot convert parameter 1 from 'System::String
__gc *' to 'const wchar_t *'
OpenFileDialog* ofd = new OpenFileDialog();
ofd->Filter = "OW Files|*.db;aepctl.dat;aepord.dat;aep|All Files|*.*";
if(ofd->ShowDialog() == DialogResult::OK)
{
wchar_t drive[_MAX_DRIVE];
wchar_t dir[_MAX_DIR];
wchar_t fname[_MAX_FNAME];
_wsplitpath( ofd->FileName ,drive,dir,fname,NULL);
}