What should i do to convert a HWND data type to LPCSTR. I need to print it to debug window using OutputDebugStringA
function
Asked
Active
Viewed 2,716 times
2

Jasir
- 677
- 1
- 8
- 26
-
If anything, something like `sscanf` with `%p` and the handle cast to `void *`. Alternatively a string stream with the same deal. – chris Oct 26 '13 at 21:43
-
@chris Don't you mean `sprintf` – Mike Vine Oct 26 '13 at 21:43
1 Answers
2
You can use std::stringstream
std::stringstream ss;
ss << hwnd;
OutputDebugStringA(ss.str().c_str());

Caesar
- 9,483
- 8
- 40
- 66