How can I convert the following code to use wcstombs_s instead of wcstombs?
char dbcs[1024];
char *pbstr = (char *)pPropVar->bstrVal;
int i = wcstombs(dbcs, pPropVar->bstrVal, *((DWORD *)(pbstr - 4)));
How can I convert the following code to use wcstombs_s instead of wcstombs?
char dbcs[1024];
char *pbstr = (char *)pPropVar->bstrVal;
int i = wcstombs(dbcs, pPropVar->bstrVal, *((DWORD *)(pbstr - 4)));
char dbcs[1024];
char *pbstr = (char *)pPropVar->bstrVal;
size_t i;
int err = wcstombs_s(&i, dbcs, 1024, pPropVar->bstrVal, *((DWORD *)(pbstr - 4)));
By the way, you can tell the compiler not to warn about non secure calls:
#define _CRT_SECURE_NO_DEPRECATE