我在一个对话框中定义了这样:
CStatic m_MoveBox;
public:
virtual BOOL Create(LPCTSTR lpszClassName,LPCTSTR LPszWindowName,DWORD dwStyle,
const RECT &rect,CWnd *pParentWnd,UINT nID,CCreateContext *pContext=NULL);
编译时去出现:Linking...
moveDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CMoveDlg::Create(char const *,char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,struct CCreateContext *)" (?Create@CMoveDlg@@UAEHPBD0KA
BUtagRECT@@PAVCWnd@@IPAUCCreateContext@@@Z)
Debug/move.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.move.exe - 2 error(s), 0 warning(s)
怎么解决,天啊!?

解决方案 »

  1.   

    CDialog::Create 
    BOOL Create( LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL );BOOL Create( UINT nIDTemplate, CWnd* pParentWnd = NULL );Return ValueBoth forms return nonzero if dialog-box creation and initialization were successful; otherwise 0.ParameterslpszTemplateNameContains a null-terminated string that is the name of a dialog-box template resource.pParentWndPoints to the parent window object (of type CWnd) to which the dialog object belongs. If it is NULL, the dialog object’s parent window is set to the main application window.nIDTemplateContains the ID number of a dialog-box template resource.ResCall Create to create a modeless dialog box using a dialog-box template from a resource. You can put the call to Create inside the constructor or call it after the constructor is invoked.Two forms of the Create member function are provided for access to the dialog-box template resource by either template name or template ID number (for example, IDD_DIALOG1).For either form, pass a pointer to the parent window object. If pParentWnd is NULL, the dialog box will be created with its parent or owner window set to the main application window.The Create member function returns immediately after it creates the dialog box.Use the WS_VISIBLE style in the dialog-box template if the dialog box should appear when the parent window is created. Otherwise, you must call ShowWindow. For further dialog-box styles and their application, see theDLGTEMPLATE structure in the Win32 SDK documentation and Window Styles in the Class Library Reference. Use the CWnd::DestroyWindow function to destroy a dialog box created by the Create function.
      

  2.   

    我看了msdn
    是不是用CStatic m_MoveBox;
    后面一定要加creat()
    但从系统报错来看
    好象是与CDialoge::creat()有什么关系??
      

  3.   

    Create是虚函数。重载时要原声明相同。
    你的好像不同