locked
_tcscpy_s function in Windows Mobile RRS feed

  • Question

  • Hi all,

    I tried to use _tcscpy_s() function but while compiling it gives unidentified error. Am not sure whether this is supported for Windows Mobile 6.5. Currently I am using _tcscpy but this function can do memory overwrite so wanted to use a safer version _tcscpy_s(). If anyone has any idea on how to use _tcscpy_s() on Windows Mobile then please let me know.

    Regards,
    CED
    Thursday, March 4, 2010 10:26 AM

Answers

  • Well, I just tried to use _tcscpy_s() in my Windows Mobile app and it works. There is no need to include tchar.h
    The function gets included from altcecrt.h file present in <InstallDir>\Microsoft Visual Studio 9.0\VC\ce\include , but it is included only if UNICODE or _UNICODE macro is defined. Is this macro defined in your project?

    Prabhu
    • Marked as answer by C.E.D Friday, March 5, 2010 7:38 AM
    Thursday, March 4, 2010 2:34 PM

All replies

  • What is the error that the compiler is throwing?

    _tcscpy_s() is documented here . Try including tchar.h


    Prabhu
    Thursday, March 4, 2010 1:12 PM
  • Hi,

    I have included tchar.h header file but on compiling the following error is given:

    error C3861: '_tcscpy_s': identifier not found

    Checked up tchar.h, no such function is defined there. Not sure whether this function is supported in Windows Mobile.

    Regards,
    CED
    Thursday, March 4, 2010 1:27 PM
  • Well, I just tried to use _tcscpy_s() in my Windows Mobile app and it works. There is no need to include tchar.h
    The function gets included from altcecrt.h file present in <InstallDir>\Microsoft Visual Studio 9.0\VC\ce\include , but it is included only if UNICODE or _UNICODE macro is defined. Is this macro defined in your project?

    Prabhu
    • Marked as answer by C.E.D Friday, March 5, 2010 7:38 AM
    Thursday, March 4, 2010 2:34 PM
  • Hi,

    I used the altcecrt.h header file and it worked. The code is compiling fine and is also working properly. Thank you.

    Regards,
    CED
    Friday, March 5, 2010 7:38 AM
  • What is the error that the compiler is throwing?

    _tcscpy_s() is documented here . Try including tchar.h


    Prabhu

    Your answer is very helpful.
    Thursday, January 27, 2011 1:19 AM