CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Posts
    60

    URGENT: what value I should fill in parameter of Crate function

    Hi guru!

    In the MSDN Library

    CHtml::Create
    virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL );

    and below is my source code that give an error when close my application

    CHtmlView* htmlview;
    htmlview->Create(NULL,NULL,WS_CHILD|WS_VISIBLE,CRect(10,10,1000,1000),this,100,NULL);
    //htmlview->Create(NULL,NULL,AFX_WS_DEFAULT_VIEW,CRect(10,10,1000,1000),this,AFX_IDW_PANE_FIRST,NULL);

    please tell me what value I should replace ...
    lpszClassName, lpszWindowName, dwStyle,
    pParentWnd, nID and pContext

    My problem is urgent.

    Thank You.

    Sorry for bad English.

  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917
    Derive view class from ChtmlView (in a sasmple I used CHtmlViewer.
    Declare member as pointer of your derived class type (m_pHtmlView in the sample).

    In the place you call Create:

    Code:
      CRuntimeClass* pClass = RUNTIME_CLASS(CHtmlViewer);
      m_pHtmlView = (CHtmlViewer*)pClass->CreateObject();
    
      m_pHtmlView->Create(NULL,
        NULL,
        WS_CHILD | WS_VISIBLE, CRect(0, 0, 200, 100),
        this,
        100);
      m_pHtmlView->SendMessage(WM_INITIALUPDATE); //#include "afxpriv.h"
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured