 |
|
 |
|
Next: WM2005 Power Management
|
| Author |
Message |
External

Since: Jan 31, 2006 Posts: 2
|
(Msg. 1) Posted: Tue Jan 31, 2006 6:27 am
Post subject: error C2065: 'SetDlgItemText' : undeclared identifier when #include Archived from groups: microsoft>public>pocketpc>developer (more info?)
|
|
|
Hi,
I am developing in eVC++ 2002 for the x86 Pocket PC 2002 emulator.
I had the following SetDlgItemText command working in my main project:
SetDlgItemText(g_hWnd, MSG_EDIT, (LPWSTR)TextBuffer);
But in the process of trying to add some dialogs to the project I have
had to include:
#include <afxwin.h>
in my StdAfx.h file.
But this causes the error:
error C2065: 'SetDlgItemText' : undeclared identifier
The dialog additions do not compile without adding the MFC components
in afxwin.h, but does anyone know why this is causing my call to
SetDlgItemText() to stop working, and what I can do to resolve this
conflict?
Thank you,
Nik |
|
| Back to top |
|
 |  |
External

Since: Jan 31, 2006 Posts: 2
|
(Msg. 2) Posted: Tue Jan 31, 2006 7:25 am
Post subject: Re: error C2065: 'SetDlgItemText' : undeclared identifier when #include [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Thanks but I don't think that is it. The function is part of the API,
so I don't think it needs a namespace. I have included <Winuser.h>
which contains SetDlgItemText
I tried a similiar function that is part of CWnd instead:
void Flush()
{
// SetDlgItemText(g_hWnd, MSG_EDIT, (LPWSTR)TextBuffer);
CWnd::SetDlgItemText(MSG_EDIT, (LPWSTR)TextBuffer);
}
But that gives me this error:
error C2352: 'CWnd::SetDlgItemText' : illegal call of non-static member
function
My function isn't static, so I don't know why this would be a
problem...
The text box is part of a window, not a dialog, so it was created like
this:
CreateEditText(MSG_EDIT, 0, 85, 240,180, (LPWSTR)TEXT(" "));
HWND CreateEditText(int ControlID, int xPos, int yPos, int Width, int
Height, LPWSTR Text)
{
return CreateWindow(TEXT("EDIT"), Text,
ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL | WS_VISIBLE |
WS_CHILD | WS_BORDER,
xPos, yPos,
Width, Height,
g_hWnd,
(HMENU)(ControlID),
g_hInst, NULL);
}
so I don't know if that has something to do with the problem? |
|
| Back to top |
|
 |  |
External

Since: Jan 16, 2006 Posts: 47
|
(Msg. 3) Posted: Tue Jan 31, 2006 9:30 am
Post subject: Re: error C2065: 'SetDlgItemText' : undeclared identifier when #include [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Namespace confusion maybe? Did you try ::SetDlgItemText?
-Chris
"baer" <nikbaer DeleteThis @gmail.com> wrote in message
news:1138739246.162334.94420@g43g2000cwa.googlegroups.com...
> Hi,
> I am developing in eVC++ 2002 for the x86 Pocket PC 2002 emulator.
> I had the following SetDlgItemText command working in my main project:
> SetDlgItemText(g_hWnd, MSG_EDIT, (LPWSTR)TextBuffer);
>
> But in the process of trying to add some dialogs to the project I have
> had to include:
> #include <afxwin.h>
> in my StdAfx.h file.
> But this causes the error:
> error C2065: 'SetDlgItemText' : undeclared identifier
>
> The dialog additions do not compile without adding the MFC components
> in afxwin.h, but does anyone know why this is causing my call to
> SetDlgItemText() to stop working, and what I can do to resolve this
> conflict?
>
> Thank you,
> Nik
> |
|
| Back to top |
|
 |  |
External

Since: Jan 16, 2006 Posts: 47
|
(Msg. 4) Posted: Tue Jan 31, 2006 12:02 pm
Post subject: Re: error C2065: 'SetDlgItemText' : undeclared identifier when #include [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
We need to see more code to see what's going on.
-Chris
"baer" <nikbaer.RemoveThis@gmail.com> wrote in message
news:1138742738.444690.272320@g47g2000cwa.googlegroups.com...
> Thanks but I don't think that is it. The function is part of the API,
> so I don't think it needs a namespace. I have included <Winuser.h>
> which contains SetDlgItemText
>
> I tried a similiar function that is part of CWnd instead:
> void Flush()
> {
> // SetDlgItemText(g_hWnd, MSG_EDIT, (LPWSTR)TextBuffer);
> CWnd::SetDlgItemText(MSG_EDIT, (LPWSTR)TextBuffer);
> }
>
> But that gives me this error:
> error C2352: 'CWnd::SetDlgItemText' : illegal call of non-static member
> function
> My function isn't static, so I don't know why this would be a
> problem...
>
> The text box is part of a window, not a dialog, so it was created like
> this:
>
> CreateEditText(MSG_EDIT, 0, 85, 240,180, (LPWSTR)TEXT(" "));
>
> HWND CreateEditText(int ControlID, int xPos, int yPos, int Width, int
> Height, LPWSTR Text)
> {
> return CreateWindow(TEXT("EDIT"), Text,
> ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL | WS_VISIBLE |
> WS_CHILD | WS_BORDER,
> xPos, yPos,
> Width, Height,
> g_hWnd,
> (HMENU)(ControlID),
> g_hInst, NULL);
> }
>
> so I don't know if that has something to do with the problem?
> |
|
| Back to top |
|
 |  |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|