how do i convert an HWND to a string LPCTSTR?
thanks
Printable View
how do i convert an HWND to a string LPCTSTR?
thanks
Code:LPCTSTR lpBuff;
wsprintf( lpBuff, "%d", hWnd);
// lpBuff now contains hWnd
cool thanks..also
is there a way to achieve what this does in VB:
in C++, or do i have to use strcat?PHP Code:cnt = GetProp(hwnd, "C" & hwnd)
thanks
basivcally, can i put 2 strings together with "&" ? without using strcat?
strcat(char *dest,char *source) returns a pointer to dest so it can be used in functions , just like you want.
:D
Code:char tmp[20];
memset(tmp,0x0,sizeof(tmp));
strcpy(tmp,"C");
cnt = GetProp(hwnd, strcat(tmp,"hwnd") );
thanks..one more thing...what is the equivalent to this: (in VB)
in C++?PHP Code:ObjPtr(iwp)
is it
thanksPHP Code:&iwp //?
If you're using C++ strings, then you can use the + operator.Quote:
Originally posted by Amon Ra
basivcally, can i put 2 strings together with "&" ? without using strcat?
Bear in mind that it won't do type conversion to strings for you, you need to define your own operators if you want that (or use a stringstream):As for ObjPtr, yep. & is the address-of operator, and its counterpart is the * dereferencing operator.Code:#include <sstream>
using namespace std;
string somecode() {
ostringstream oss;
int y = 5;
oss << "Hello " << y;
return oss.str();
}