Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

error C2065: 'SetDlgItemText' : undeclared identifier when..

 
   Soft32 Home -> PDA -> Pocket PC Developer RSS
Next:  WM2005 Power Management  
Author Message
baer

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
Login to vote
baer

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
Login to vote
Chris Tacke, MVP

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
Login to vote
Chris Tacke, MVP

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
Login to vote
Display posts from previous:   
Related Topics:
SetDlgItemText not working on mobile 2003 - Hi there, I'm porting an app to mobile 2003 using vs2005 and I have a dialog form with a static text control. I am t...

Email message unique identifier - Hello, I need to find a unique identifier for each email message from my inbox folder. I have tried to get one using P...

Geting the unique Identifier of the PPC - hi, How can my program ( .net CF using c#) retrieve the unique Identifier of my Pocket PC ? ( either UUID or the Ass...

using EDB, "identifier not found" problem - Hi, I'm trying to get started with EDB in VS2005. I've got: #define EDB #include "windbase.h" but when...

PRB: Platform Manager Reports Error Message: Connection Fa.. - Microsoft Knowledge Base Article - 271190 PRB: Platform Manager Reports Error Message: Connection Failed (Error Code =...

Check SQL Query - if correct, no syntax error, procee some.. - Hi, I have a textbox which allow user to enter their SQL query. So that query will be dynamic each time cos it is base...
       Soft32 Home -> PDA -> Pocket PC Developer All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
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

Categories:
 Windows
 Linux
 Mac
  PDA


[ Contact us | Terms of Service/Privacy Policy ]