|
hello
thanx
but
when i use these statement in the function then it hangs the system.
plz help me i'm not getting any proper solution.
why m_hWnd value got NULL?
what should be solution for it.
byeee
|
|
|
|
|
|
sir in setdlgitemtext function.
it gots NULL and does not show any message in the dialog box control.
|
|
|
|
|
how to declare idc_message and i need to see your code for answer to you
whitesky
|
|
|
|
|
it just control id.
from .rc file.
which type of code u want i will show u every thing.
byee
|
|
|
|
|
You can declare a variable for this control
whitesky
|
|
|
|
|
I have Declare a variable for it but i'm not getting what code should i write for it.
becoz i haven't use this before could u guide me to further steps or Code Lines.
|
|
|
|
|
Its one idea try this code and answer to me
<br />
#define IDC_EDIT 1000<br />
<pre><br />
CEdit m_Edit;<br />
m_Edit.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,200,23),this,IDC_EDIT1);<br />
and use this code instead your id like "m_Edit.SetWindowText();"<br />
answer to me
whitesky
|
|
|
|
|
when i use this code then it give me error "unsupported opertaion was attempted".
and here we don't have code to show the message in text box too.
|
|
|
|
|
if you run this you get a editbox in left corner window
HWND hWnd;//declare is Global
<br />
hWnd=CreateWindow("EDIT","",WS_CHILD|WS_VISIBLE,0,0,150,23,m_hWnd,NULL,AfxGetInstanceHandle(),NULL);<br />
::SetWindowText(hWnd,"Test");<br /> and where you use this code (which function)
whitesky
|
|
|
|
|
yes i tried this with my code but i'm not getting any thing.
plz help me
|
|
|
|
|
By any chance is this happening on a seperate thread?
Are you sure that the IDC_Message is a valid control ID for the control you are looking for? Are you sure that it has already been created and has a message pump pumping messages for the dialog?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
yes i'm sure that Control ID is Correct but for "Are you sure that it has already been created and has a message pump pumping messages for the dialog?"
But How to Check the this i didn't do anything for that.
|
|
|
|
|
Use ::GetDlgItem( CTRLID ) to get an HWND for the control. Then use ::IsWindow( HWND ) to see if it is valid. Do not assume that a non-NULL HWND is always a valid one - it could be garbage, or it could refer to a destroyed control (especially if it is stored in a variable or the control is destroyed in-between the two calls).
A brute-force way to see if the control has a pump is to use ::SendMessageTimeout(...) to send a WM_NULL value to the control and see if the message is processed or if an error/timeout happens.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
i used it like this
this->GetDlgItem(IDC_Realm)->SetWindowText("Hello");
but it snot working
where i'm doing wrong plz tell me.
bye
|
|
|
|
|
Please try the steps I gave above as demonstrated.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
ok
when i use ::IsWindow( HWND );
then it gives me error that HWND is not a valid expression.
what to do now?
thanx
|
|
|
|
|
How to create this control I guess this "IDC_message" isnt edit control.
whitesky
|
|
|
|
|
Sir this is a Edit Control.
i have just use resource file.
make a dialog box and within it a Edit Control From Toolbox.
plz help me sir
|
|
|
|
|
HWND hWndMessage = ::GetDlgItem( m_hWnd, IDC_Message );
if( ::IsWindow( hWndMessage ) )
{
} Get It?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
when i use this code then if condition does not satisfy and it passes the if condition.
what to do?
|
|
|
|
|
If the call to ::IsWindow(...) fails, then you are trying to refer to an incorrect window/control. You could be in the wrong dialog (or parent window), or have the wrong control ID, or just be calling the code at a point before the controls are created or after they are destroyed.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
hello sir
i'm getting somthing.
i'm using a function EventCallbackProc() which is viop function.
in this for calling my own funciton i have made a object of the dialog class.
like this ---------- sipxmngr dlg;
and in this (calling function) i'm trying to set the text in as text box.
if i don't make a object of the class then. it give me a error
"not static member calling function"
what to do tell me
|
|
|
|
|
hello!
I am trying to devolop win32 static library. In this library there is a String table and a function 'getString' which retrieves the string.
I am calling LoadString function for which i need instance of the calling application. But whenever i define getString prototype as follow:
GetString(HINSTANCE hinst)
Compiler gives error as HINSTANCE is undecleared identifier.
I am devoloping this project without MFC control. Where i am doin wrong?
Do i need to include any header files??
plz help
Thx in advance!
|
|
|
|
|
#include <windows.h>
John
-- modified at 9:35 Tuesday 27th June, 2006
|
|
|
|