|
aavesh wrote: the control which is i'm updating do exist.
Not according to this assertion:
ASSERT(::IsWindow(m_hWnd));
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
this is exactly i want to know how to update the control according to this.
|
|
|
|
|
You must wait until the window exists before it can be updated. What part of that are you not understanding?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi
this is exactly i'm not getting becoz when my dialog is initialized and my button events are working nice.....after this when any call comes then m_hwnd variable value got NULL.
how this is happenning?
i don't think so this problem should take much time..
but i'm not getting proper solution plz help me.
thanx
|
|
|
|
|
aavesh wrote: ...after this when any call comes then m_hwnd variable value got NULL.
Where is this m_hwnd coming from? I would start there (to see why a NULL window handle is being sent to your code).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i have used follwing code :-
void CTESTsipXtapiDlg::handleOffering(SIPX_CALL hCall)
{
SetWindowText(IDC_Realm,"Hello");
}
it does not show the text in the text box.
do u suggest6 me any other way..could u give me ur yahoo id so we chat directly.
thanx
|
|
|
|
|
aavesh wrote: SetWindowText(IDC_Realm,"Hello");
Is IDC_Realm a valid window handle (not a resource id)? Have you tried:
GetDlgItem(IDC_Realm)->SetWindowText("Hello");
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Make IDC_STATIC_NEW_CALL as a control variable of type CStatic and then try SetWindowText on it .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
hello
if i use this then m_hwnd will reinitialize itself.
becoz always at the time of calling a function it gets NULL.
i'm trying now.
byeeee
|
|
|
|
|
Hello
This Code is not working.
when i use this code then it hangs my system.
plz help me.
thanx
|
|
|
|
|
Hi,
Is there any way to get the size of an allocated memory buffer knowing only the its address?
Thank you all 
|
|
|
|
|
|
No
it doesn't worked for me !!!
The _msize function returns the size, in bytes, of the memory block allocated by a call to calloc, malloc, or realloc.
Thank you anyway
|
|
|
|
|
In case of objects allocated with new operator, the number of items seems to be stored in a word before the pointer:
MyClass * a = new MyClass[10];
__int32 size = *(((__int32*)a) - 1);
This works only when the class contains destructor.
The size does not seem to be stored in such manner for destructor-less objects and for fundamental types. But for this cases, _msize appears to return the size in bytes.
|
|
|
|
|
The short answer, is no. The long answer is that if you know something about the memory, you may be able to. For example, if it is a BSTR you can look 4 bytes before its "handled" address or use SysStringLen(...) .
If you know that the memory came from a particular heap (or heap manager), you may be able to crack the heap structures used to maintain memory allocations. You also need to know where the memory came from in order to use functions like _msize(...) , _msize_dbg(...) , GlobalSize(...) , etc.
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!)
|
|
|
|
|
Here it is:
LPVOID data = MapViewOfFile(m_hMap, _dwDesiredAccess, 0, _dwOffset, _dwNbBytes);
I need to know the size of the data buffer.
I call this code after resizing a map file with 8ko but I can acess only the first 4ko
could someone help me?!!
|
|
|
|
|
hatemtalbi wrote: I need to know the size of the data buffer.
Isn't that what _dwNbBytes represents?
hatemtalbi wrote: I call this code after resizing a map file with 8ko but I can acess only the first 4ko
What in the world is "ko?"
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
no, _dwNbBytes == 0
ko mean kb == 1024 bytes
thx
|
|
|
|
|
hatemtalbi wrote: no, _dwNbBytes == 0
Then you simply need to look at the size of the file, since the entire file was mapped.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
that s the problem!!! it seems that the size of the file is larger than the memory buffer returned. I don't understand why 
|
|
|
|
|
wrote smth like this...
variables:
CTabCtrl m_tabctrl;
CDlg1* dlg1;
CDlg2*dlg2
MyDialog constructors ... :
CDlg1::CDlg1(CWnd* pParent /*=NULL*/)
//: CDialog(CDlg1::IDD, pParent)
{
this->Create(CDlg1::IDD, pParent);
this->ShowWindow(SW_NORMAL);
}
BOOL CMainDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_tabctrl.InsertItem(0,_T("1111"));
m_tabctrl.InsertItem(1,_T("2222"));
dlg1=new CDlg1(GetDlgItem(IDC_TAB1));
dlg1->ShowWindow(SW_SHOW);// error IsWindow=false
}
|
|
|
|
|
Hope I understood your question
<br />
dlg1=new CDlg1();<br />
dlg1->create(...)<br />
dlg->GetDlgItem(IDC_TAB1)->ShowWindow(SW_SHOW); <br />
whitesky
|
|
|
|
|
did as u say....
CMyDialog *MyDialog;//in MainDlg header file
MyDialog = new CMyDialog; //in mainDlg constructor
CMainDlg::OnInitDialog{
TC_ITEM TabItem;
TabItem.mask = TCIF_TEXT;
TabItem.pszText = _T("111111");
m_tabctrl.InsertItem( 0, &TabItem );
TabItem.mask = TCIF_PARAM;
TabItem.lParam = (LPARAM)MyDialog;
m_tabctrl.SetItem(0, &TabItem);
VERIFY(MyDialog->Create(CMyDialog::IDD, &m_tabctrl));
MyDialog->ShowWindow(SW_SHOW);
}
CMyDialog constructor
CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: CDialog(CMyDialog::IDD, pParent)
{
/*this->Create(CThumbViewDlg::IDD, pParent);
this->ShowWindow(SW_NORMAL);*/
}
error in HWND CDataExchange::PrepareCtrl
if (pSite == NULL)
{
TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE);
AfxThrowNotSupportedException();//<-------------------------------------|
}
|
|
|
|
|
one question "VERIFY(MyDialog->Create(CMyDialog::IDD, &m_tabctrl));"
your previous code was good this->Create(CThumbViewDlg::IDD, pParent);
this->ShowWindow(SW_NORMAL);
and why you dont use MyDialog->Create();
whitesky
|
|
|
|
|
NoName II wrote: dlg1=new CDlg1(GetDlgItem(IDC_TAB1));
dlg1->ShowWindow(SW_SHOW);// error IsWindow=false
you just allocated the memory.
You may have to create the dialog using CreateDialog or CreateDialogIndirect
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|