[gme-users] Create/Open/Manage Sub-window in GME

Kevin Smyth ksmyth at isis.vanderbilt.edu
Thu Sep 17 09:44:42 CDT 2009


Hi,

To show an FCO in the model editor, try this:

CComPtr<IGMEOLEApp> CComponent::m_GMEApplication;
void CComponent::InvokeEx(CBuilder &builder,CBuilderObject *focus, 
CBuilderObjectList &selected, long param)
{
    /////////////////////// Getting GME OLE App //////////////////////////
    CComPtr<IMgaClient> client;   
    CComQIPtr<IDispatch> pDispatch;
    HRESULT s1 = 
builder.GetProject()->GetClientByName(L"GME.Application", &client);

    if ((SUCCEEDED(s1)) && (client != 0))
    {
        HRESULT s2 = client->get_OLEServer(&pDispatch);
        if ((SUCCEEDED(s2)) && (pDispatch != 0))
        {
            COMTHROW(pDispatch->QueryInterface(&m_GMEApplication));
        }
    }
...
// Cleanup after everything is done
    m_GMEApplication.Release();
}

// This function cannot be called within a transaction
void CComponent::ShowFCO(const CBuilderObject* fco)
{
    // Shows FCO in the main window:
    CComPtr<IMgaFCO> mgafco = fco->GetIObject();
    HRESULT res = m_GMEApplication->ShowFCO(mgafco);
}

I'm not sure there's a way to close a model editor window.

Kevin

Ioannis Ntalamagkas wrote:
> Hi everyone
>
> I am developing an interpreter for a model that has containment 
> relationship. I would like to ask whether I can programmatically control 
> GME within my interpreter to open/close/set focus a new sub-window or 
> tab (in GME9) to display part of the model I am interested in.
>
> Thank you in advance.
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3286 bytes
Desc: S/MIME Cryptographic Signature
Url : http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20090917/2b0455ee/attachment.bin 


More information about the gme-users mailing list