|
Hi Mike!
I do not think using extern C can bring us all the benefits (DLL can be used across different linkers, for example, VC and VB), but it can also bring us trouble, for example, we can not use function overloading in C++ when we use extern C since C does not have function overloading. Right?
regards,
George
|
|
|
|
|
hello
yesterday i was getting Assertion error when i try the following code :-
void CTESTsipXtapiDlg::handleOffering(SIPX_CALL hCall)
{
sipxAudioEnableSpeaker(g_hInst,SPEAKER);
char cCallId[512];
sipxCallGetID(hCall, cCallId, sizeof(cCallId));
SetDlgItemText(IDC_Message,"New Call");
}
but today its not givingme any assertion error but not displaying any message in text box.
plz help me.
i'm stucj here
|
|
|
|
|
In certain situations the following fragment helps:
SetDlgItemText(IDC_Message, "New Call");
GetDlgItem(IDC_Message)->RedrawWindow();
Perhaps this is what you need.
|
|
|
|
|
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!)
|
|
|
|