/usr/share/doc/racket/mzcom/index.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>MzCOM: Racket as a Windows COM Object</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="" class="tocviewselflink" data-pltdoc="x">Mz<span class="mywbr"> </span>COM:<span class="mywbr"> </span> Racket as a Windows COM Object</a></td></tr></table></div><div class="tocviewsublistonly" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="#%28part._.Loading_.Mz.C.O.M%29" class="tocviewlink" data-pltdoc="x">Loading Mz<span class="mywbr"> </span>COM</a></td></tr><tr><td align="right">2 </td><td><a href="#%28part._guids%29" class="tocviewlink" data-pltdoc="x">GUIDs</a></td></tr><tr><td align="right">3 </td><td><a href="#%28part._.Methods%29" class="tocviewlink" data-pltdoc="x">Methods</a></td></tr><tr><td align="right">4 </td><td><a href="#%28part._.Events%29" class="tocviewlink" data-pltdoc="x">Events</a></td></tr><tr><td align="right">5 </td><td><a href="#%28part._.Errors%29" class="tocviewlink" data-pltdoc="x">Errors</a></td></tr><tr><td align="right">6 </td><td><a href="#%28part._.Evaluation_thread%29" class="tocviewlink" data-pltdoc="x">Evaluation thread</a></td></tr><tr><td align="right">7 </td><td><a href="#%28part._.Acknowledgments%29" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr></table></div></div></div><div class="tocsub"><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber"></span><a href="#%28part._top%29" class="tocsubseclink" data-pltdoc="x">Mz<span class="mywbr"> </span>COM:<span class="mywbr"> </span> Racket as a Windows COM Object</a></td></tr><tr><td><span class="tocsublinknumber">1<tt> </tt></span><a href="#%28part._.Loading_.Mz.C.O.M%29" class="tocsubseclink" data-pltdoc="x">Loading Mz<span class="mywbr"> </span>COM</a></td></tr><tr><td><span class="tocsublinknumber">2<tt> </tt></span><a href="#%28part._guids%29" class="tocsubseclink" data-pltdoc="x">GUIDs</a></td></tr><tr><td><span class="tocsublinknumber">3<tt> </tt></span><a href="#%28part._.Methods%29" class="tocsubseclink" data-pltdoc="x">Methods</a></td></tr><tr><td><span class="tocsublinknumber">4<tt> </tt></span><a href="#%28part._.Events%29" class="tocsubseclink" data-pltdoc="x">Events</a></td></tr><tr><td><span class="tocsublinknumber">5<tt> </tt></span><a href="#%28part._.Errors%29" class="tocsubseclink" data-pltdoc="x">Errors</a></td></tr><tr><td><span class="tocsublinknumber">6<tt> </tt></span><a href="#%28part._.Evaluation_thread%29" class="tocsubseclink" data-pltdoc="x">Evaluation thread</a></td></tr><tr><td><span class="tocsublinknumber">7<tt> </tt></span><a href="#%28part._.Acknowledgments%29" class="tocsubseclink" data-pltdoc="x">Acknowledgments</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.1</span></div><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <span class="nonavigation">← prev</span> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">up</a> <span class="nonavigation">next →</span></span> </div><h2 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""top""><a name="(part._top)"></a><a name="(part._.Mz.C.O.M__.Racket_as_a_.Windows_.C.O.M_.Object)"></a>MzCOM: Racket as a Windows COM Object</h2><div class="SAuthorListBox"><span class="SAuthorList"><p class="author">Paul Steckler</p></span></div><p><span class="stt">MzCOM.exe</span> is a Windows COM (i.e., Component Object Model) class
wrapper for Racket.</p><p>During normal installation of MzCOM, the executable is registered as a
COM object automatically. If that registration fails or if you move
the Racket installation, re-register <span class="stt">MzCOM.exe</span> with</p><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">installation</span>›</span><span class="stt">\lib\MzCOM.exe /RegServer /v</span></p><p>The <span class="stt">MzCOM.exe</span> executable will find DLLs and library collections
relative to its own path.</p><h3 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""Loading_MzCOM"">1<tt> </tt><a name="(part._.Loading_.Mz.C.O.M)"></a>Loading MzCOM</h3><p>To load a COM object, COM hosts require a COM class name or a ProgID.
MzCOM has the class name <span class="stt">"MzObj Class"</span> and the ProgID
<span class="stt">"MzCOM.MzObj.</span><span class="sroman">‹<span style="font-style: italic">version</span>›</span><span class="stt">"</span>, where <span class="sroman">‹<span style="font-style: italic">version</span>›</span> is
6.1.</p><p>In the Visual BASIC 6 environment, from the <span class="ssansserif">Project|References (VB6)</span>, check <span class="ssansserif">MzCOM 1.0 Type Library</span>. In
Visual BASIC .NET, choose <span class="ssansserif">Project|Add Reference</span>, and
from the <span class="ssansserif">COM</span> tab, select <span class="ssansserif">MzCOM 1.0 Type Library</span>.
In your code, declare a variable, then assign to it:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">DIM schemeObject AS MzObj</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">SET schemeObject = NEW MzObj</span></p></td></tr></table></p><p>From Visual C++:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">#include "mzcom.h"</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">CLSID clsid;</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">IMzObj *pIMzObj;</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">CoInitialize(NULL);</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">CLSIDFromProgID(L"MzCOM.MzObj.<version>",&clsid);</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">CoCreateInstance(clsid,NULL,CLSCTX_SERVER,IID_IMzObj, (void **)&pIMzObj);</span></p></td></tr></table></p><p>where <span class="stt"><version></span> is the version number. You’ll need the
definition of <span class="stt">IID_IMzObj</span> (see <a href="#%28part._guids%29" data-pltdoc="x">GUIDs</a>). The header file
<span class="stt">"mzcom.h"</span> is generated as <span class="stt">"src\worksp\mzcom\"</span> when
building from the Racket source distribution. The above C/C++ code
is for illustration; your actual code should check return values, of
course.</p><p>Using <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=mysterx&rel=index.html&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">mysterx</span></a> to manipulate COM objects within Racket,
you can load MzCOM with either</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=mysterx&rel=methprop.html%23%2528def._%2528%2528lib._mysterx%252Fmain..rkt%2529._cci%252Fcoclass%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">cci/coclass</a></span><span class="hspace"> </span><span class="RktVal">"MzObj Class"</span><span class="RktPn">)</span></p></blockquote><p>or</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=mysterx&rel=methprop.html%23%2528def._%2528%2528lib._mysterx%252Fmain..rkt%2529._cci%252Fprogid%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">cci/progid</a></span><span class="hspace"> </span><span class="RktVal">"MzCOM.MzObj.<version>"</span><span class="RktPn">)</span></p></blockquote><p>Consult your documentation for loading MzCOM into other COM
environments. MzCOM is compiled as a “dual-mode” class, meaning its
methods may be called directly or by using OLE Automation.</p><h3 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""guids"">2<tt> </tt><a name="(part._guids)"></a>GUIDs</h3><p>When compiled from the Racket source distibrution, the directory
<span class="stt">"src\worksp\mzcom\"</span> contains the file <span class="stt">"MzCOM_i.c"</span>
that contains GUIDs for MzCOM. Those GUIDs are as follows:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="hspace"> </span><span class="stt">const IID IID_IMzObj =</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span><span class="hspace"> </span><span class="stt">{0xA604CBA8,0x2AB5,0x11D4,{0xB6,0xD3,0x00,0x60,0x08,0x90,0x02,0xFE}};</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">const IID LIBID_MZCOMLib =</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span><span class="hspace"> </span><span class="stt">{0xA604CB9C,0x2AB5,0x11D4,{0xB6,0xD3,0x00,0x60,0x08,0x90,0x02,0xFE}};</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">const IID DIID__IMzObjEvents =</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span><span class="hspace"> </span><span class="stt">{0xA604CBA9,0x2AB5,0x11D4,{0xB6,0xD3,0x00,0x60,0x08,0x90,0x02,0xFE}};</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt">const CLSID CLSID_MzObj =</span></p></td></tr><tr><td><p><span class="hspace"> </span><span class="stt"></span><span class="hspace"> </span><span class="stt">{0xA3B0AF9E,0x2AB0,0x11D4,{0xB6,0xD2,0x00,0x60,0x08,0x90,0x02,0xFE}};</span></p></td></tr></table></p><p>which represent the <span class="stt">IMzObj</span> interface, the MzCOM type library, the
<span class="stt">IMzObjEvents</span> interface, and the <span class="stt">MzObj</span> class, respectively.</p><h3 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""Methods"">3<tt> </tt><a name="(part._.Methods)"></a>Methods</h3><p>MzCOM support three COM methods:</p><ul><li><p><a name="(idx._(gentag._0._(lib._mzcom/mzcom..scrbl)))"></a><span class="stt">void About()</span></p><p>Takes no arguments and displays an informational
dialog.</p></li><li><p><a name="(idx._(gentag._1._(lib._mzcom/mzcom..scrbl)))"></a><span class="stt">BSTR Eval(BSTR input)</span></p><p>Takes and returns strings (specifically, <span class="stt">BSTR</span>s). The returned
value is the result of evaluating the input expression,
formatted as a string. The input string may contain several
S-expressions. The embedded Racket updates its environment
with each evaluation. Therefore, it is possible to define
procedures in a call to <span class="stt">Eval</span>, and use the procedures in
subsequent calls.</p></li><li><p><a name="(idx._(gentag._2._(lib._mzcom/mzcom..scrbl)))"></a><span class="stt">void Reset()</span></p><p>Resets the Racket environment to the initial environment.
Also, the custodian for the primary Racket thread is invoked,
shutting all its managed values.</p></li></ul><h3 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""Events"">4<tt> </tt><a name="(part._.Events)"></a>Events</h3><p>MzCOM supports a single event.</p><ul><li><p><a name="(idx._(gentag._3._(lib._mzcom/mzcom..scrbl)))"></a><span class="stt">SchemeError()</span></p><p>Passed a string (specifically, a <span class="stt">BSTR</span>) that explains the error.</p></li></ul><h3 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""Errors"">5<tt> </tt><a name="(part._.Errors)"></a>Errors</h3><p>When an error occurs in MzCOM, it creates a COM error object. C and
C++ clients can use <span class="stt">GetErrorInfo</span> to retrieve error information.
Clients implemented in other languages typically have some equivalent
means to obtain COM error information.</p><h3 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""Evaluation_thread"">6<tt> </tt><a name="(part._.Evaluation_thread)"></a>Evaluation thread</h3><p>The Racket evaluator runs in a Win32 thread created when MzCOM is
loaded. If an expression kills the primary Racket thread, as in</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=threads.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._kill-thread%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">kill-thread</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=threads.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-thread%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">current-thread</a></span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote><p>then the evaluator Win32 thread is also killed.
When that happens, subsequent calls to <span class="stt">Eval</span> will fail.</p><h3 x-source-module="(lib "mzcom/mzcom.scrbl")" x-part-tag=""Acknowledgments"">7<tt> </tt><a name="(part._.Acknowledgments)"></a>Acknowledgments</h3><p>MzCOM was developed in response to a query by
Andre Van Meulebrouck. Andre also did extensive
testing with Visual BASIC.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <span class="nonavigation">← prev</span> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">up</a> <span class="nonavigation">next →</span></span> </div></div></div><div id="contextindicator"> </div></body></html>
|