0

I have the following line of code:

LPSTR address = T2A((LPTSTR)hostAddress);

Can I convert LPCTSTR hostAddress to LPSTR without using T2A macros from "afxpriv.h"?

Matthieu M.
  • 287,565
  • 48
  • 449
  • 722
SKINDER
  • 950
  • 3
  • 17
  • 39

1 Answers1

1

This macro is defined in in AtlBase.h, use this h-file which is public and doesn't require any dependencies.

Correction: it is not defined directly in AtlBase.h, but it is enough to include AtlBase.h to use string conversion macros.

Alex F
  • 42,307
  • 41
  • 144
  • 212