<div dir="ltr"><div><span style="font-family:arial,helvetica,sans-serif">Dear Kevin,<br></span></div><span style="font-family:arial,helvetica,sans-serif">Thank a lot. Now its working. In the previous attempt I choose the "From Typelib" from the Add class drop down. Like it was stated as bellow in the previous link :<br></span><pre><span style="font-family:arial,helvetica,sans-serif"> a., Invoke the Class Wizard (CTRL-W)
b., Click on Add Class... and select From a Type Library...
c., In the file chooser select the GME.exe file
e., In the next dialog select IGMEOLEApp<br><br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">Where I wasn't able to create a new class by inheriting CDialog.<br><br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">Thankfully <br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">Sanjib<br></span></pre><span style="font-family:arial,helvetica,sans-serif"></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 3:37 PM, Kevin Smyth <span dir="ltr"><<a href="mailto:ksmyth@isis.vanderbilt.edu" target="_blank">ksmyth@isis.vanderbilt.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
While I don't think it addresses your issue, the code in that link
should read:<br>
<br>
Folder root = project->getRootFolder();<br>
ASSERT(root);<br>
std::set<FCO> rootFCOs = root->getRootFCOs();<br>
FCO firstFCO = *rootFCOs.begin();<br>
CComPtr<IMgaFCO> mgaFCO = firstFCO->getFCOI().p; // Modify
this line to show other object<br>
CComPtr<IMgaProject> mgaProject = project->getProjectI().p;<br>
ASSERT(mgaProject);<br>
<br>
CComPtr<IMgaClient> gmeClient;<br>
CComBSTR gmeName("GME.Application");<br>
COMTHROW(mgaProject->GetClientByName(gmeName, &gmeClient));<br>
ASSERT(gmeClient);<br>
<br>
CComPtr<IDispatch> gmeDispatch;<br>
COMTHROW( gmeClient->get_OLEServer(&gmeDispatch) );<br>
<br>
CComQIPtr<IGMEOLEApp> gmeApp(gmeDispatch);<br>
<br>
CComPtr<IMgaTerritory> terr;<br>
COMTHROW(mgaProject->get_ActiveTerritory(&terr));<br>
ASSERT(terr);<br>
COMTHROW(mgaProject->CommitTransaction());<br>
<br>
gmeApp->ShowFCO(mgaFCO);<br>
<br>
COMTHROW( mgaProject->BeginTransaction(terr) );<br>
<br>
<br>
<br>
Showing a dialog is not specific to GME, but here is how to do it:<br>
First create a dialog by right-clicking on the project, and
selecting Class Wizard.... Hit Add Class. Fill out the name, and
select CDialog as the base class.<br>
<br>
Then you can show the dialog by including resource.h and MyDialog.h,
then inserting this code:<br>
CMyDialog dlg;<br>
dlg.DoModal();<br>
<br>
Kevin<div><div class="h5"><br>
<br>
<br>
<div>On 12/4/2014 7:35 PM, Sanjib Das wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div>
<div>
<div>Dear Concern,<br>
<br>
</div>
I am using the latest version of GME (GME-14.10.29). And
trying to develop addon using source (GME-14.10.29_src) on
MSVS2010.<br>
</div>
<br>
</div>
<div><b>Can someone please post an working example for creating
a window/dialog/ popup on BON2 addon ?</b><br>
</div>
<div><br>
<br>
Though there are few example found about modeless dialog box ,
such as<br>
<a href="http://list.isis.vanderbilt.edu/pipermail/gme-users/2004-July/000502.html" target="_blank">http://list.isis.vanderbilt.edu/pipermail/gme-users/2004-July/000502.html</a><br>
<br>
</div>
Unfortunately after following the instruction I ended up with
errors as bellow:<br>
<br>
CComPtr<IMgaFCO> mgaFCO = firstFCO->getFCOI(); is
returning ::<br>
<br>
1 IntelliSense: more than one user-defined conversion
from "BON::FCOPtr" to "ATL::CComPtr<IMgaFCO>" applies:
d:\hiwi\bon2component123\bon2component123\bon2component.cpp
106<br>
<br>
<br>
CComPtr<IMgaProject> mgaProject =
project->getProjectI(); returns::<br>
<br>
" 2 IntelliSense: more than one user-defined conversion
from "BON::ProjectPtr" to "ATL::CComPtr<IMgaProject>"
applies:
d:\hiwi\bon2component123\bon2component123\bon2component.cpp
107<br>
"<br>
And <br>
<br>
IGMEOLEApp gmeApp(gmeDispatch); <br>
" 3 IntelliSense: object of abstract class type
"IGMEOLEApp" is not allowed:
d:\hiwi\bon2component123\bon2component123\bon2component.cpp
118<br>
"
<div><br>
<br>
</div>
<div>I will be looking forward to have a response. <br>
<br>
</div>
<div>Thankfully <br>
</div>
<div><br>
Sanjib Das<br>
</div>
<div>University of Stuttgart <br>
Institut für Luftfahrtsysteme<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
gme-users mailing list
<a href="mailto:gme-users@list.isis.vanderbilt.edu" target="_blank">gme-users@list.isis.vanderbilt.edu</a>
<a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
gme-users mailing list<br>
<a href="mailto:gme-users@list.isis.vanderbilt.edu">gme-users@list.isis.vanderbilt.edu</a><br>
<a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</a><br>
<br></blockquote></div><br></div>