|
-
May 11th, 1999, 06:00 AM
#1
MFC C++
Can someone please tell me why is that whenever I use SetWindowText or TextOut in my source code, I get compiler complain of :
"SetWindowTextA is not a member of HWND" and,
"TextOutA is not a member of HWND" ?? Where does the "A" comes from.
I have no such problem if the same function calls are use in the context of the dialog code. Example under MyClass::OnInitDialog() or MyClass::OnOK()
-
May 11th, 1999, 06:05 AM
#2
Re: MFC C++
take a look at winuser.h
WINUSERAPI
BOOL
WINAPI
SetWindowTextA(
HWND hWnd,
LPCSTR lpString);
WINUSERAPI
BOOL
WINAPI
SetWindowTextW(
HWND hWnd,
LPCWSTR lpString);
#ifdef UNICODE
#define SetWindowText SetWindowTextW
#else
#define SetWindowText SetWindowTextA
#endif // !UNICODE
A is for ANSI, W (wide chars) for Unicode
-
May 11th, 1999, 06:46 AM
#3
Re: MFC C++
Thanks Lothar,
I have used SetWindowText(pwnd, "Some Text"), of which pwnd was obtained from HWND pwnd = ::FindWindow(MyDialog, NULL)...something like that !!
But the compiler complains anyway. (By the way, I was trying to change the text on a Button)
How can the problem be solved ?
-
May 11th, 1999, 06:51 AM
#4
Re: MFC C++
if you need to call the API function instead of the class member method, you should use ::SetWindowText instead. Did you try that?
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
|