Now I added layout to my QWinWidget and it seems to work .Although I am not sure why.

Qt Code:
  1. int MyCDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
  2. {
  3. if (CDialog::OnCreate( lpCreateStruct ) == -1 )
  4. return -1;
  5. win=new QWinWidget( this->m_hWnd );
  6. MyFrame * dialog=new MyFrame(win);
  7. QVBoxLayout mylayout=new QVBoxLayout ;
  8. mylayout->addWidget(dialog);
  9. win->setLayout(mylayout);
  10. win->move(0,0);
  11. win->show();
  12. return 0;
  13. }
To copy to clipboard, switch view to plain text mode 

and in my OnSize handler :

Qt Code:
  1. void MyCDailog::OnSize(UINT nType,int cx,int cy)
  2. {
  3. win->resize(cx,cy);
  4.  
  5. }
To copy to clipboard, switch view to plain text mode