Vc++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eshwarry
    New Member
    • Nov 2007
    • 1

    Vc++

    It is always saying to use StringCbCatA or StringCChCatA instead of strcat
    It is always saying to use StringCbPrintfA or StringCchPrintf A instead of sprintf
    So how to fix up this problem??????? Any information reply <email address removed per guidelines>
    Last edited by weaknessforcats; Nov 10 '07, 04:19 PM. Reason: Removed email address
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    I've moved your question to the C/C++ Forum section where it belongs.

    kind regards,

    Jos

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Are you writing in C for Unix/Linux?? If so, then use strcat().

      If you are writing in C++ use the C++ Standard Library string class.

      StringCbCatA is a Microsoft replacement for strcat. It is a secure version of strcat. Microsoft has deprecated strcat infavor of StringCbCatA and that is what VC++ is telling you.

      Therfore, if you are writing Microsoft C, then use StringCbCatA. Please note that this also requires that you use the TCHAR mappings.'

      You will need to include strsafe.h and add strsafe.lib as a linker addtional dependency if VC++ has not already done this as part of the project creation.

      The above applies to StringCChCatA which is the same as StringCbCatA but has further restrictions on the allowable destination buffer size.

      Ditto for StringCbPrintfA or StringCchPrintf A.

      Comment

      Working...