|
SteamEngine wrote: delete a CStatic Object
A CStatic object created on the stack within a window is automatically destroyed. If you create the CStatic object on the heap by using new , you must call delete on the object to destroy it when you are done with it.
delete myObj;
DestroyWindow();
To destroy a C++ Windows object, use DestroyWindow, not "delete".
-- modified at 7:07 Monday 31st July, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: f you create the CStatic object on the heap by using new , you must call delete on the object to destroy it when you are done with it.
delete myObj;
naah you have to call delete MyObj after DestroyWindow()
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
SteamEngine wrote: how to delete a CStatic Object. wt is the correct function? wts the syntax and parameters needed???
how did you created it~!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi All,
Is there some class similar to CIPAddressCtrl (which is available in desktop MFC library), which
can be used in WinCE.NET platform, as MFC for Win CE does not support CIPAddressCtrl class?
If YES then plz tell me its details????
Regards
Frozen
|
|
|
|
|
What about a masked edit control?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
well i hav no idea abt that... i will check...
thanks for help......
any other way?
|
|
|
|
|
I have a CTreeCtrl derived control which is populated in the OnInitDialog handler, and then all items are selected still in the OnInitDialog handler. The items are successfully selected but when the dialog displays only the first item is highlighted. Does anyone know what I need to add to get all the items highlighted automatically when the dialog is doisplayed?
|
|
|
|
|
CTreeCtrl supports only single selection na? then how can u set selection to more than one item?
nave
|
|
|
|
|
Hello
I create a childview and also create process. I want to paint something in the childview. But I try to change the code in childview but some errors happen.
CString SelfTimer;
SelfTimer.Format(_T("%d"),_T("123"));
invalidateRect.SetRect(50,200,450,232);
HBRUSH hBrush = CreateSolidBrush(RGB(255,0,255));
::SetBkMode(g_hTimeMemDC, TRANSPARENT);
::FillRect(g_hTimeMemDC, &invalidateRect, hBrush);
::SetTextColor(g_hTimeMemDC,RGB(0,0,0));
::DrawText(g_hTimeMemDC, SelfTimer, -1, &invalidateRect, DT_LEFT | DT_TOP);
InvalidateRect(HWND(param), &invalidateRect, false);
DeleteObject(hBrush);
CPaintDC dc(HWND(param));
if(g_hTimeMemDC)
TransparentImage(dc.m_hDC,invalidateRect.left,invalidateRect.top,invalidateRect.Width(),invalidateRect.Height(), g_hTimeMemDC,invalidateRect.left,invalidateRect.top,invalidateRect.Width(),invalidateRect.Height(), RGB(255, 0, 255));
the build error is left of '.m_hDC' must have class/struct/union in TransparentImage function
who could I fix the issue or the way I program is wrong??
Any suggestion is useful!! Thanks!!
|
|
|
|
|
Whats Application type?
CPainDC is a class derived from CDC
|
|
|
|
|
The application is to unuse the childview function but also want to paint in the childview. So I create a thread to paint out of childview.
When I push the button in childview, it set the event to the waitforsigleobject in ThreadProc and then paint the childview.
But I cannot build the codes successful, could u tell me what is wrong for the codes??
Any suggestion is useful!! Thanks!!
|
|
|
|
|
If you want to draw i think you need to WM_PAINT message and if you use from this message i think you dont have problem.
|
|
|
|
|
tryin to create modeless dialog...
m_dlg->Create(CMyDlg::IDD, &m_tabctrl/*CTabCtrl*/);// ASSERT(pWnd->m_hWnd == NULL); // debug error
constructor:
CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
//: CDialog(CMyDlg::IDD, pParent)
{
this->Create(CMyDlg::IDD, pParent);
this->ShowWindow(SW_NORMAL);
}
|
|
|
|
|
NoName II wrote: m_dlg->Create(CMyDlg::IDD, &m_tabctrl/*CTabCtrl*/);// ASSERT(pWnd->m_hWnd == NULL); // debug error
in the constructor it self the window is created. So why u gonne call Create again...?
And if u stick to the above code then code like this
if( m_dlg->m_hWnd )
{
m_dlg->DestroyWindow();
}
m_dlg->Create(CMyDlg::IDD, &m_tabctrl/*CTabCtrl*/);// ASSERT(pWnd->m_hWnd == NULL);
nave
|
|
|
|
|
NoName II wrote: //: CDialog(CMyDlg::IDD, pParent)
You should remove this code from your constructor. because it will create a dialog with the IDD (resource ID) you are passing. that is why it failed.
see MSDN to know how to create modeless dialog?[^]
You can see the following in the documentation... that
For a modeless dialog box, you must provide your own public constructor in your dialog class.
|
|
|
|
|
Sarath. wrote: because it will create a dialog with the IDD (resource ID) you are passing
i don't agree
see the code inside the constructor.
CDialog::CDialog(UINT nIDTemplate, CWnd* pParentWnd)<br />
{<br />
AFX_ZERO_INIT_OBJECT(CWnd);<br />
<br />
m_pParentWnd = pParentWnd;<br />
m_lpszTemplateName = MAKEINTRESOURCE(nIDTemplate);<br />
m_nIDHelp = nIDTemplate;<br />
}
is only sets the member varaiable.Wont create the dialog
nave
|
|
|
|
|
yes once I had went through the code...
for the ease of undestanding I explained it that manner.
when creating a modal dialog, the error occurs at module state handling.
The function get called twice. first on the ctor and Create function
Anyway I dont know more about the same. It would nice informative if you share how a modal dialog asserts on the above scenario
-- modified at 6:48 Monday 31st July, 2006
|
|
|
|
|
check the code he posted.
in the constructor itself he creates the dialog. I.e
CMyDlg dlg; // Dialog is created in this line itself.
then he calls
dlg.Create(...) the dialog is already created, hence Assertion fails will come and most probably from the function
void AFXAPI AfxHookWindowCreate(CWnd* pWnd)
{
..........
ASSERT(pWnd->m_hWnd == NULL); // only do once
...........
}
nave
|
|
|
|
|
So it's not part of CDialog. it's part of CWnd right? then how the creation with template name specified occurs?
|
|
|
|
|
Sarath. wrote: then how the creation with template name specified occurs?
i dont understand what u mean. In what ever way create the dialog, atlast ::CreateDialogIndirect(..) funtion is called.
nave
|
|
|
|
|
Sarath. wrote: You should remove this code from your constructor.
That code is fine. It was the extra Create() call that was the problem. Note the assertion indicated exactly what the problem was (i.e., the window handle was non-NULL ).
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hope I understood your question
<br />
CMyDlg *mydialog;<br />
mydialog=new CMyDlg(this);<br />
<br />
CMyDlg::CMyDlg(CWnd* pParent)<br />
: CDialog(CMyDlg::IDD, pParent)<br />
{<br />
Create(pParent);<br />
ShowWindow(SW_NORMAL);<br />
}<br />
|
|
|
|
|
Sachin Gedam wrote: Now I am facing a problem, how to get this abbreviation from client side?
Why aren't you using GetTimeZoneInformation() ?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i want client's(web browser) time zone information.. now i store time zone related information in xml file and to access particular time zone information only time zone abbrevatoin is only the way
Sachin Gedam
(Software Engg.)
Pune India
|
|
|
|
|
I don't quite follow you. You wanted to know how to obtain the timezone using Visual C++. I suggested you use GetTimeZoneInformation() . Now you are talking about browsers and XML files. What exactly is it that you are looking for?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|