Re: MFC: adding a control into a dialog window



But I would imagine that the problem is that your parentwnd is NULL. GetDlgItem() will get the CWnd* of a child control of the dialog, and there is not one with the ID IDD_HELLO_DIALOG. Just pass the "this" pointer as the parent.

Thanks.

But a much easier way to do this kind of thing is to put the static control on the template and show/hide it as needed.

Um... When I was coding Foxpro, sometimes, it's neater to insert control into a form after design time. So I am trying to repeat what I did with Foxpro here.

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 2.6.26.5
^ ^ 21:53:01 up 3 days 6:43 3 users load average: 1.00 1.00 1.00
? ? (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa/
.



Relevant Pages

  • Re: MFC: adding a control into a dialog window
    ... GetDlgItemwill get the CWnd* of a child control of the dialog, and there is not one with the ID IDD_HELLO_DIALOG. ... When I was coding Foxpro, sometimes, it's neater to insert control into a form after design time. ...
    (microsoft.public.vc.mfc)
  • Re: Moving to C#
    ... some point, to keep track of a pointer then I'm thinking that it would be a very elite profession indeed and the trades industry wouldn't be suffering for iron workers, carpenters, plumbers and the like as it is. ... Most upper level management doesn't know jack about programming anyway, so they can't filter out poor programmers. ... The pointer not being freed can easily be profiled and deteremined because you should have NO pointers left over when you are done. ... If you are writing flight control software and NOT running code through the proper quality control, then it doesn't matter what language/framework/OS you are using - someone is going to have a very bad day! ...
    (borland.public.delphi.non-technical)
  • Re: Issue with casting CString to LPARAM and recasting it to CString...
    ... List Control class of MFC. ... of maintaining a unique sequence number which is a CString and member ... Why are you returning a pointer? ... itself is in complete control of the LPARAM value, and it is not managed by anyone else. ...
    (microsoft.public.vc.mfc)
  • Re: Issue with casting CString to LPARAM and recasting it to CString...
    ... List Control class of MFC. ... CString* MyItem::GetListItemSequence ... because returning a pointer can be dangerous...for example, it allows the caller to reach ... itself is in complete control of the LPARAM value, and it is not managed by anyone else. ...
    (microsoft.public.vc.mfc)
  • Re: parallel structure(s) used in sorting CListCtrl?
    ... Sorting gives a pointer to the LPARAM, ... There is no need to maintain anything outside the control for this. ...
    (microsoft.public.vc.mfc)

Loading