<!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=iso-8859-1">
<META content="MSHTML 6.00.2800.1491" 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 name="PersonName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><!--[if !mso]>
<STYLE>
st1\:*{behavior:url(#default#ieooui) }
</STYLE>
<![endif]-->
<STYLE>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:TimesNewRoman;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
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><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></BODY></HTML>