derive from iCustomGui



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/04/2004 at 04:33, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.207 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    I'm completely helpless, I hope one of you guys knows the solution....
    I want to do a custom gui derived from CustomGuiData. The SDK says:
     virtual CDialog* Alloc(const BaseContainer &settings)
      {
        T* dlg = gNew T(settings, GetPlugin());
        if (!dlg) return NULL;
      
        CDialog *cdlg = dlg->Get();
        if (!cdlg) return NULL;
        
        return cdlg;
      }
      
    In the above

    T
    

    stands for a type derived from _<_a class=link href= "mk:@msitstore:d:\maxon\cinema_4d_r8\r8sdkchm2003-10-02.chm::/pages/c4d_gui/class_icustomgui458.html"_>_SPAN title=class iCustomGui : public SubDialog"> color=#606420iCustomGui/SPAN.
    Ok, so I build a class iTreeViewGui : public iCustomGui, overwrite the virtual functions. When I try to compile, an error occurs at the line above in the Alloc with the gNew:
    error C2660: 'iTreeViewGui::iTreeViewGui' : Function does not accept 2 parameters
    Ok...so I tried to define a constructor with 2 parameters within iTreeViewGui, and within it just call the 2 parameter-constructor of iCustomGui.
    Then the error error C2512: 'iCustomGui' : no standart constructor available occurs.
    Fighting with it since about 2 hours now, and I'm really at the end of my wisdom...anyone out there who knows what I'm doing wrong????



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/04/2004 at 04:48, xxxxxxxx wrote:

    Well....now I can compile it, but I'm definitely unhappy about my solution:
    I opened c4d_gui.h and just gave the iCustomGui the thing what was missing....a standart constructor: iCustomGui(){};
    That can't be the intended way to do it, right? What is the solution for it? Or am I the first man on earth deriving from iCustomGui? I'm really curious what the solution is......



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/04/2004 at 00:43, xxxxxxxx wrote:

    The correct way to do it is:
    class MyGui : public iCustomGui
    {
    public:
    MyGui(const BaseContainer &settings,CUSTOMGUIPLUGIN *plugin);
    }
    MyGui::MyGui(const BaseContainer &settings,CUSTOMGUIPLUGIN *plugin) :
    icustomGui(settings,plugin)
    {
    }
    Please note, that this code is not tested yet, but it sounds logical, thanks to Tilo!



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/04/2004 at 01:02, xxxxxxxx wrote:

    It works, just note the typing error of iCustomGui, in the last part I accidently wrote it with a small C.....


Log in to reply