<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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 link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=RO>Modul in care se folosesc testele e prost
documentat.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=RO>Nu m-am prins inca ce trebuie exact facut cu
cele 2 obj-uri, ControlMonitor.obj si ControlRW.obj. Se linkeaza in dll-uri si
functiile lor se exporta? Am facut asta si nu merge decat daca le declar cu __declspec(dllimport)
in headerul din test(</span><b><span lang=RO style='font-size:10.0pt;
font-family:"Courier New"'>HeaderTest.h</span></b><span lang=RO>) si cu __declspec(dllexport)
in CallbackMonitor.h si CallbackRW.h. Oarecum evident, daca vrei sa importi o
functie dintr-un dll!<o:p></o:p></span></p>
<p class=MsoNormal><span lang=RO><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=RO>Acelasi lucru se aplica la toate functiile importate
in test.exe din dll-uri.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=RO>Sample din </span><b><span lang=RO
style='font-size:10.0pt;font-family:"Courier New"'>HeaderTest.h</span></b><span
lang=RO>:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=RO><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:green'>//////////////PENTRU TESTE<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>Verifica</span>(<span
style='color:blue'>int</span> <span style='color:#060006'>e</span>,<span
style='color:blue'>int</span> <span style='color:#060006'>s</span>,<span
style='color:blue'>int</span> <span style='color:#060006'>w</span>,<span
style='color:blue'>int</span> <span style='color:#060006'>x</span>,<span
style='color:blue'>int</span> <span style='color:#060006'>q00</span>,<span
style='color:blue'>int</span> <span style='color:#060006'>q11</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>IncNrX</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>DecNrX</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>GetNrX</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>ResetNrX</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>SetNrCond</span>(<span
style='color:blue'>int</span> <span style='color:#060006'>nrCond</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>FreeNrCond</span>(<span
style='color:blue'>int</span> <span style='color:#060006'>nrCond</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>VerificaRW</span>(<span
style='color:blue'>int</span> <span style='color:#060006'>r</span>, <span
style='color:blue'>int</span> <span style='color:#060006'>w</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>VerificaW</span>(<span
style='color:blue'>int</span> <span style='color:#060006'>w</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>VerificaR</span>(<span
style='color:blue'>int</span> <span style='color:#060006'>r</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>typedef</span><span style='font-size:
10.0pt;font-family:"Courier New"'> <span style='color:blue'>struct</span>
{ } <span style='color:#060006'>Monitor</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:green'>/////////////EXPORTATE DE LibMonitor.lib<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#060006'>Monitor</span><span style='font-size:
10.0pt;font-family:"Courier New"'>* <span style='color:#060006'>Create</span>(<span
style='color:blue'>int</span> <span style='color:#060006'>conditions</span>,<span
style='color:blue'>char</span> <span style='color:#060006'>policy</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>Enter</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>Leave</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>Wait</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>, <span
style='color:blue'>int</span> <span style='color:#060006'>cond</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>Signal</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>, <span
style='color:blue'>int</span> <span style='color:#060006'>cond</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>Broadcast</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>, <span
style='color:blue'>int</span> <span style='color:#060006'>cond</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>Destroy</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:green'>////////////EXPORTATE DE LibRW.lib<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#060006'>Monitor</span><span style='font-size:
10.0pt;font-family:"Courier New"'>* <span style='color:#060006'>CreateRWMonitor</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>GetNrConds</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>StartCit</span>(<span
style='color:#060006'>Monitor</span>* <span style='color:#060006'>m</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>StopCit</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>StartScrit</span>(<span
style='color:#060006'>Monitor</span>* <span style='color:#060006'>m</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>void</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#060006'>StopScrit</span>(<span
style='color:#060006'>Monitor</span> *<span style='color:#060006'>m</span>);<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>void</span><span style='font-size:10.0pt;font-family:"Courier New"'>
<span style='color:#060006'>ResetScritCit</span>();</span><span lang=RO><o:p></o:p></span></p>
<p class=MsoNormal><span lang=RO><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=RO>Sunt declarata de parca ar fi intr-un alt
c/cpp oarecare.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=RO><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=RO>Eu zic ca testul este gresit. Cel putin pe
sistemul meu nu merge decat daca le declar cu __declspec(dllimport). <o:p></o:p></span></p>
</div>
</body>
</html>