MSDN > フォーラム ホーム > Visual C++ Language > error C2512: 'ecgclass' : no appropriate default constructor available
質問する質問する
 

回答済みerror C2512: 'ecgclass' : no appropriate default constructor available

  • 2009年11月4日 9:14kiranpreddy05 ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    Hi,
    While compiling i am gettin the error descrobed as above...
    Tat is the only error i m getting pls help me out...
    I m using MSVC++ 6.0 enterprise edition.

    void PegAppInitialize(PegPresentationManager *pPresent)
    {
        /* WB Auto-Generated End (20)  */

        /* WB Auto-Generated Start (21)  */
        PegResourceManager::InstallResourcesFromTable(&Default_Theme_ResourceTable);
        //error is pointed here //   ecgclass *pWin = new ecgclass();
        pPresent->Center(pWin);
        pPresent->Add(pWin);
        /* WB Auto-Generated End (4)  */
    }


    ecgclass::ecgclass(PEGINT Left, PEGINT Top, ecgicount) :
        PegWindow(FF_THIN)
    {
        PegRect ChildRect;
        PegThing *pChild1, *pChild2;
    .
    .
    .
    .
    .
    .
    .

    }

回答

  • 2009年11月4日 9:52Shival Mathur ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済み
    Hi

    Since you have provided a parameterized constructor for ecgclass, you need to create a default constructor for this too. Compiler will not do this for you now that you have a user defined parameterized constructor. This usually happens if you try to create an object of ecgclass like

    ecgclass myEcgClass;

    Shival

すべての返信

  • 2009年11月4日 9:52Shival Mathur ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済み
    Hi

    Since you have provided a parameterized constructor for ecgclass, you need to create a default constructor for this too. Compiler will not do this for you now that you have a user defined parameterized constructor. This usually happens if you try to create an object of ecgclass like

    ecgclass myEcgClass;

    Shival
  • 2009年11月4日 9:58Viorel_MVPユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答の候補

    Specify required parameters. For example: ecgclass * pWin = new ecgclass(10, 10, 1).