Post by James5950Dear All,
How to change _wfopen_s for BCB? or any instead?
In BCB there is _wfopen. Add stdio.h to use it.
FILE *fileHandle = _wfopen(filename, filemode);
You must understand that all these _s functions microsoft invented are
there just for better safety (so they say). All of them have name formed
like this : <existing_function>_s . It is safe for the test purporses to
replace _s functions with ones without _s with some minor changes in
paramteres. There is no need to ask every time you need to replace a
function. Just go to the MSDN and see the documentation for both version
of functions (_wfopen_s and _wfopen in this case) to know what needs to
be changed.
In BCB _wfopen_s could be quickly implemented like this :
#include <errno.h>
#include <stdio.h>
int __cdecl _wfopen_s( FILE **pFile,
const wchar_t *filename,
const wchar_t *mode ) {
*pFile = _wfopen(filename, mode);
return errno;
}