trouble with strtok_s

  • Thread starter Thread starter lfvoydfv
  • Start date Start date
L

lfvoydfv

Guest
I have a project I converted from VC 6.0 to VS 2010. After changing all strtok calls to strtok_s, the program built without errors. Now I'm creating an MFC app from scratch. The same code as in the converted project is now giving a compile error. The code is this:

CString Instr;


Token = strtok_s(Instr.GetBuffer(0), Separators, &NextToken);


The compiler doesn't like Instr.GetBuffer(0). The error is:


error C2664: 'strtok_s' : cannot convert parameter 1 from 'wchar_t *' to 'char *'


Why would this statement with strtok_s compile in the converted project but not in the new project? The types and syntax are identical.

Continue reading...
 
Back
Top