How to use _countof(m_szFileName) on BCB2007?
Thanks for any comments,
Best regards,
James
It is called RTL_NUMBER_OF in BCB2007. To use it include windows.h.
The original code like this
WCHAR m_szFileName[256];
//MS use _countof(m_szFileName) to get the size of m_szFileName.
wcsncpy_s(m_szFileName, _countof(m_szFileName), pszFileName, _TRUNCATE);
I use sizeof(m_szFileName) for instead now.
Best regards
James
Just replace _countof with RTL_NUMBER_OF and you got the same thing, or
you can put this small define in the code
#ifdef __BORLANDC__
#define _countof RTL_NUMBER_OF
#endif
and you do not need to change the code at all.