<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:st1 =
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"></o:SmartTagType><!--[if !mso]>
<STYLE>st1\:* {
        BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: TimesNewRoman;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
P {
        FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle18 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=white>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2>You can look up MGA error codes in the Mga.idl file
(located in the Interfaces folder of your GME installation).
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2>"Your" error code means: E_MGA_NOT_IN_TRANSACTION
("Operation must execute within transaction"). The slight modification, you've
made caused this problem: in the initalize method you will find other lines
initating/commiting transactions. Generally, it is a bad idea to query to model
database in the draw method anyway (it is slow)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2>I highly suggest to read (at least the beginning of) the
"MGA Library" documentation (Mga.pdf) if you're into decorator
development.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2>--</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2>Peter Volgyesi</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=108253814-21032005><FONT face=Arial
color=#0000ff size=2>ISIS, Vanderbilt University</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
gme-users-bounces@list.isis.vanderbilt.edu
[mailto:gme-users-bounces@list.isis.vanderbilt.edu] <B>On Behalf Of </B>Yi
Chu<BR><B>Sent:</B> Sunday, March 20, 2005 10:44 PM<BR><B>To:</B> Matthew J.
Emerson; gme-users<BR><B>Subject:</B> Re: [gme-users] Redraw decorator when
object attribute changes<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Hi Matthew,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank you very much. I tried a piece of code
(modified from the class for the UML) as follows in the Draw method of the
decorator class and it throws an exception #0x87650035. I don't know what this
exception code means.</FONT></DIV>
<DIV><FONT face=Arial
size=2>///////////////////////////////////////////////</FONT></DIV>
<DIV><FONT face=Arial size=2>CComPtr<IMgaFCO> mgaFco =
m_mgaFco;</FONT></DIV>
<DIV><FONT face=Arial size=2>CComBSTR attr("test"); //the
name of the Boolean type attribute</FONT></DIV>
<DIV><FONT face=Arial size=2>VARIANT_BOOL bVal;</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT
color=#0000ff></FONT></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff>try</FONT>
{</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>
COMTHROW(mgaFco->get_BoolAttrByName(attr,&bVal));</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff>catch</FONT>
(hresult_exception &ee) {</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>
AfxMessageBox(ee.what());</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial
size=2>////////////////////////////////////////////</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The only difference between my code and the UML
class decorator code is that the latter one is in the method Initialize(),
while my code is in Draw(). It seems that the value of the FCO's attribute can
only be retrieved during initialization of this decorator object. But I want
to let the decorator to display according to the dynamically changed attribute
value.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any ideas?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Yi</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=mjemerson@isis.vanderbilt.edu
href="mailto:mjemerson@isis.vanderbilt.edu">Matthew J. Emerson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=y.chu@sympatico.ca
href="mailto:y.chu@sympatico.ca">Yi Chu</A> ; <A
title=gme-users@list.isis.vanderbilt.edu
href="mailto:gme-users@list.isis.vanderbilt.edu">gme-users</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, March 20, 2005 5:25
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [gme-users] Redraw
decorator when object attribute changes</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi Yi
Chu,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I don’t much about
decorators, but you might consider looking at the decorator code for the UML
class diagrams environment which ships with GME. That decorator changes the
visualization of each Class instance to reflect the attribute names and
types listed in a string attribute.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">--Matt<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> Yi
Chu [mailto:y.chu@sympatico.ca] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Sunday, March 20, 2005 1:31
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> <st1:PersonName
w:st="on">gme-users</st1:PersonName><BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> [<st1:PersonName
w:st="on">gme-users</st1:PersonName>] Redraw decorator when object attribute
changes</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I wanted to change the shape of
the decorator for an atom object in my model according to the current value
of an attribute. I am thinking of using the Draw() method of the CDecorator
class that is generated with “decorkit.zip” to do the work. Is it possible
that I get access to the current object’s attribute in this Draw() method? I
tried to use “</SPAN></FONT><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">m_mgaFco->get_AttributeByName()</SPAN></FONT><FONT
face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">” but it
seemed does not work for me. </SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Many thanks in
advance.</SPAN></FONT><FONT face=TimesNewRoman size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: TimesNewRoman"><o:p></o:p></SPAN></FONT></P>
<P><B><I><FONT face="Times New Roman" color=blue size=3><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: blue; FONT-STYLE: italic">Yi
Chu</SPAN></FONT></I></B><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P></DIV></DIV></DIV></DIV>
<P>
<HR>
<P></P>No virus found in this incoming message.<BR>Checked by AVG
Anti-Virus.<BR>Version: 7.0.300 / Virus Database: 266.7.3 - Release Date:
3/15/2005<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>