Cxxxview的 OnInitialUpdate()里面

解决方案 »

  1.   

    还是OnInitDlg,处理wm_initdlg消息
      

  2.   

    如果不行,就处理wm_create,OnCreate
      

  3.   

    呵,都知道啊?同意 delphihero(阿蒙) 。也可以在OnCreate中
      

  4.   


    啊,不知道各位有没有试过。我在提问之前在OnCreate中: CRect rect;
    m_clcCsv.GetClientRect(&rect);
    (i),LVCFMT_LEFT, rect.right/4);
    m_clcCsv.InsertColumn(0,"1", LVCFMT_LEFT, rect.right/4);
    m_clcCsv.InsertColumn(1,"2 ", LVCFMT_LEFT, rect.right/4);
    会立刻有错误!不知道为什么???
    另:是没有OnInitDlg的。
      

  5.   

    Cxxxview的 OnInitialUpdate()里面应该没问题,我同意楼上的delphihero
      

  6.   

    no, I cut below to OnInitalUpdate() before, but nothing:: CRect rect;
    m_clcCsv.GetClientRect(&rect);
    m_clcCsv.InsertColumn(0,"1",LVCFMT_LEFT,rect.right/4);
    m_clcCsv.InsertColumn(1,"2 ",LVCFMT_LEFT, rect.right/4);
    UpdateData(FALSE);
    Help...
      

  7.   

    remember, This is in SDI- FormView, and I add the List-Box into Form
      

  8.   

    你看到 CxxxView::OinitialUpdate();最后面程序结束前加入你要的代码
      

  9.   

    将初始化工作放到一个函数中,然后在不同的地方尝试调用。
    一般是在onInitdlg中就可以运行,
    你说没有oninitdlg是什么意思?
      

  10.   


    在SDI-Form-View里面,尽管是用Dialog,但是如果你check一下,
    是没有WM_INITDLG这个消息的,是和Dialog不同的。
    所以不能初始化 ListBox我在OnInitalUpdate() 添加以下代码,试图初始化ListBox(有没有错?)
    CRect rect;
    m_clcCsv.GetClientRect(&rect);
    m_clcCsv.InsertColumn(0,"1",LVCFMT_LEFT,rect.right/4);
    m_clcCsv.InsertColumn(1,"2 ",LVCFMT_LEFT, rect.right/4);
    UpdateData(FALSE);
    但是没有效果谢谢
      

  11.   

    我猜是你的listctrl风格未设待我试试
      

  12.   

    果然 。呵呵 你把 view:改成report就看到了。
      

  13.   

    果然 。呵呵 你在资源里把listctrl控件的 view属性:改成report就看到了。
      

  14.   

    啊,dockbar, you hit the point!啊,自己没有留意。555555555555浪费了时间。