Re: Add a CListCtrl in my CFormView



What is 0x58658 ?

Anyway, you should have something like

GetDlgItem ( IDC_TOKEN_LIST) -> GetWindowRect ( &rect)
ScreenToClient ( &rect)
m_TokenList.Create(dwStyle, rect, this, 0x58658? )


Vincent RICHOMME wrote:
Hi,

I have a CFormView in which I have put a CStatic in the resource form.
In my code I would like to replace the CStatic by a ClistCtrl so I am trying this :


void CGeneralView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();

// Get Rect of my CStatic
CRect rect; GetDlgItem(IDC_TOKEN_LIST)->GetClientRect(&rect);
DWORD dwStyle = LVS_ICON;
BOOL bRet = m_TokenList.Create(dwStyle, CRect(0,0,0,0), this, 0x58658);
m_TokenList.ShowWindow(TRUE);
}


The problem is the ClistCtrl is not the right place. I suppose it's because my form view is resized. So does it mean I cannot create my control in OnInitialUpdate method ?
Or Maybe I need to catch the OnSize event and inform my control ???
.



Relevant Pages

  • Re: ListView Column Resize
    ... This control does not properly respond to this message. ... For vertical scroll bar presence I retrieved the ListView per page count ... Basically, it's GetWindowRect - GetClientRect ... ByRef lpRect As RECT) As Long ...
    (microsoft.public.vb.controls)
  • Re: How to add a Dialog in a View
    ... That, is, a POINTER TO A RECT STRUCTURE! ... That causes the framework to call OnDraw. ... void CPreviewDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT ... Resizing a picture control in a formview ...
    (microsoft.public.vc.mfc)
  • problem of creating WMP activex control in MFC program
    ... One of my views will create a WMP activex control in some cases, ... fine if we build project using VC6, but when building with VS2005, the WMP ... const RECT& rect, CWnd* pParentWnd, UINT nID, ...
    (microsoft.public.windowsmedia.player)
  • Re: allowing a text box to grow
    ... CRect rect, rcParent; ... "SteveR" wrote in message ... However, if it's not asking too much, could someone list the sequence of steps I would take to govern the size of my text box according to the string length? ... Do I need another variable to represent the control as an object? ...
    (microsoft.public.vc.mfc)
  • Re: allowing a text box to grow
    ... CRect rect, rcParent; ... // Check whether control needs to be resized ... to the length of the string in the control? ... such an arrangement for my error messages and would like it to fit my ...
    (microsoft.public.vc.mfc)