CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Location
    India
    Posts
    232

    String operations in _UNICODE

    Hi Gurus,

    I am making a Win32 DLL with _UNICODE defined.
    H ere I have a function FindKey(TCHAR * target, TCHAR *key) wherein I have to search the target for occurence of key and replace it with a constant. My problem is that while using _tcscpy on these strings, I am getting unpredictable results, sometimes the calling .exe is also abruptly terminated. What I want to know that while writing a DLL is there some extra precaution to be taken while defining strings and performing operations.
    Sarve Bhavantu Sukheenah,
    Sarve Santu Niramayah,
    Sarve Bhadrani Pashyantu,
    Ma Kashchit dukh bhag bhavet.

  2. #2
    Join Date
    Apr 2004
    Posts
    76
    Hi chmanish,

    #define both UNICODE and _UNICODE (and verify _MBCS is not defined).

    Also, consider using _tcscspn. See http://msdn.microsoft.com/library/de..._._mbscspn.asp.

    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured