[gme-users] Generation of popup window as a child in BONComponent2 plugin

Sanjib Das cnt.sanjib at googlemail.com
Mon Dec 1 02:34:09 CST 2014


Dear Concern,

I am trying to build a GME component, which requires a list popup like
"Select Connection Role Type". I found "Select Connection Role" is
implemented in MgaResolver.cpp. by including Dialoglist.h.

And also in TabelEditor plugin this whole popup window is implemented in
RawCompnent.cpp including GridDlg.h

In my plugin I have extended CDialog class to generate a pop up. The
extended Class is using constructors as bellow::

CAddOnDlg(CWnd* dlgParent=NULL);
    CAddOnDlg(IMgaProject *project, IMgaFCO *currentobj, IMgaFCOs
*selectedobjs, CWnd* dlgParent=NULL)

Which are adopted and modified from Dialoglist.h

I have been using the following code for popup::

void CAddOnDlg::demo(){
        using namespace GMEConsole;
        CComBSTR projname;
        CComBSTR focusname = "<nothing>";
        CComPtr<IMgaTerritory> terr;
        Console::Out::WriteLine("Debug point 1");
        /*if( FAILED(d_project->CreateTerritory(NULL, &terr)) ) {
            ASSERT(("COMTHROW: Throwing HRESULT exception. Press IGNORE",
false));
            throw d_project->CreateTerritory(NULL, &terr);
        }
        if( FAILED(d_project->BeginTransaction(terr)) ) {
            ASSERT(("COMTHROW: Throwing HRESULT exception. Press IGNORE",
false));
            throw d_project->BeginTransaction(terr);
        }*/
        //COMTHROW(d_project->CreateTerritory(NULL, &terr));
        //COMTHROW(d_project->BeginTransaction(terr));
        Console::Out::WriteLine("it's connection");
        try{
            Console::Out::WriteLine("inside try");

            CAddOnDlg p_dlg=new CAddOnDlg;

            /*CAddOnDlg *p_dlg=new CAddOnDlg(NULL);
            p_dlg->d_project=this->d_project;
            p_dlg->d_currentobj=this->d_currentobj;
            p_dlg->d_selectedobjs=this->d_selectedobjs;
            Console::Out::WriteLine("after object creation");*/


            p_dlg.DoModal();

            //if(p_dlg.DoModal()==IDCANCEL){
            //    /*if( FAILED(d_project->AbortTransaction()) ) {
            //        ASSERT(("COMTHROW: Throwing HRESULT exception. Press
IGNORE", false));
            //        throw d_project->AbortTransaction();
            //    }*/
            //}
            //    //COMTHROW(d_project->AbortTransaction());
            //else{
            //    /*if( FAILED(d_project->CommitTransaction()) ) {
            //        ASSERT(("COMTHROW: Throwing HRESULT exception. Press
IGNORE", false));
            //        throw d_project->CommitTransaction();
            //    }*/
            //}
                //COMTHROW(d_project->CommitTransaction());
        }
        catch (...){
            Console::Out::WriteLine("inside catch");
            d_project->AbortTransaction();
            Console::Out::WriteLine("before throw");
            throw;
        }
}

Which is compiling properly but not running.

Thus, I am requesting some suggestion on how a popup window can be
implemented as a child  in BON2Component.


Thankfully
Sanjib
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20141201/d0913740/attachment.html 


More information about the gme-users mailing list