rvelthuis

MyDLLExports.cpp

Oct 13th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #define __BUILDING_DLL
  2. #include "MyDLLExports.h"
  3. #include "windows.h"
  4. #include <string>
  5. #include <cwchar>
  6.  
  7. // appends "abcdef" to text in girdi.
  8. // girdi must be user supplied buffer of at least 256 wchar_t.
  9. // return value is girdi
  10. wchar_t *__stdcall deneme(wchar_t *girdi)
  11. {
  12.     // No need to convert to single byte character strings.
  13.     std::wstring ws(girdi);
  14.     ws.append(L"abcdef");
  15.  
  16.     // Copy text in string to buffer provided by user.
  17.     std::wcscpy_s(girdi, 256, ws.c_str());
  18.     return girdi;
  19.  
  20. //---------------------------------------------------
  21. //  alternatively, you could simply do:
  22. //---------------------------------------------------
  23. //  std::wscat_s(girdi, 256, L"abcdef");
  24. //  return girdi;
  25. //---------------------------------------------------
  26. }
Advertisement
Add Comment
Please, Sign In to add comment