|
-
Dec 7th, 2001, 03:19 PM
#1
Thread Starter
Hyperactive Member
Hwnd
how do i convert an HWND to a string LPCTSTR?
thanks
Amon Ra
The Power of Learning.
-
Dec 7th, 2001, 04:24 PM
#2
Code:
LPCTSTR lpBuff;
wsprintf( lpBuff, "%d", hWnd);
// lpBuff now contains hWnd
-
Dec 7th, 2001, 05:26 PM
#3
Thread Starter
Hyperactive Member
cool thanks..also
is there a way to achieve what this does in VB:
PHP Code:
cnt = GetProp(hwnd, "C" & hwnd)
in C++, or do i have to use strcat?
thanks
Amon Ra
The Power of Learning.
-
Dec 7th, 2001, 05:27 PM
#4
Thread Starter
Hyperactive Member
basivcally, can i put 2 strings together with "&" ? without using strcat?
Amon Ra
The Power of Learning.
-
Dec 7th, 2001, 05:59 PM
#5
strcat(char *dest,char *source) returns a pointer to dest so it can be used in functions , just like you want.

Code:
char tmp[20];
memset(tmp,0x0,sizeof(tmp));
strcpy(tmp,"C");
cnt = GetProp(hwnd, strcat(tmp,"hwnd") );
-
Dec 7th, 2001, 09:47 PM
#6
Thread Starter
Hyperactive Member
thanks..one more thing...what is the equivalent to this: (in VB)
in C++?
is it
thanks
Amon Ra
The Power of Learning.
-
Dec 9th, 2001, 08:00 AM
#7
Monday Morning Lunatic
Originally posted by Amon Ra
basivcally, can i put 2 strings together with "&" ? without using strcat?
If you're using C++ strings, then you can use the + operator.
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):
Code:
#include <sstream>
using namespace std;
string somecode() {
ostringstream oss;
int y = 5;
oss << "Hello " << y;
return oss.str();
}
As for ObjPtr, yep. & is the address-of operator, and its counterpart is the * dereferencing operator.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|