<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="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[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]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-believe-normal-left:yes;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<![if mso 9]>
<style>
p.MsoNormal
        {margin-left:3.0pt;}
</style>
<![endif]>
</head>

<body lang=FR link=blue vlink=purple style='margin-left:3.0pt;margin-top:3.0pt;
margin-right:3.0pt;margin-bottom:.75pt'>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Hi Henk, <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Basically it shouldn’t
matter what tool you use to create the DLL. The problem can be on two levels:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Either the function
implementing the type is not exported in the DLL, or TRNSYS doesn’t
recognize it. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>To check the first,
simply use a tool like the dependency walker to look at your DLL (Microsoft
gives one away for free – type depends.exe in google to find it). A
correct DLL should show a C-style function called “TYPE201” (with a
little little grey “C” in the line that lists it). If it isn’t
there, you have trouble telling your compiler to export the function. In the
Microsoft world, one way to say this is the line <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>extern</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
<font color="#a31515"><span style='color:#A31515'>"C"</span></font> <font
color=blue><span style='color:blue'>__declspec</span></font>(<font color=blue><span
style='color:blue'>dllexport</span></font>)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>generated by the Studio. It
may have a different equivalent in your world (including compiler directives
and/or options). <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>To check the second, make
sure your type returns 1 at every possible exit point. If it’s a complicated
one, try a simple one first (like one saying only “ return 1;”  ).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Hope this helps,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Werner<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<div>

<div class=MsoNormal align=center style='margin:0cm;margin-bottom:.0001pt;
text-align:center'><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><b><font size=2
face=Tahoma><span lang=EN-GB style='font-size:10.0pt;font-family:Tahoma;
font-weight:bold'>De :</span></font></b><font size=2 face=Tahoma><span
lang=EN-GB style='font-size:10.0pt;font-family:Tahoma'> Henk Stijnen
[mailto:Stijnen@dwa.nl] <br>
<b><span style='font-weight:bold'>Envoyé :</span></b> jeudi 19 juillet
2007 11:34<br>
<b><span style='font-weight:bold'>À :</span></b> trnsys-users@engr.wisc.e</span></font><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>du<br>
<b><span style='font-weight:bold'>Objet :</span></b> [TRNSYS-users] C++
dll for new components</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>Hi all,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>I'm trying to
implement a new component (Type 201) in C++ following the sectio 9.1 from
the "Getting Started" manual. I've made the cpp via the wizard,
compiled the dll and placed it in %Trnsys16_1%\UserLib\ReleaseDLLs.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>Now the
simulation gives an error, can't find the component. The log file shows the following:<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>*** Notice at
time       
:         0.000000<br>
    Generated by Unit     : Not applicable
or not available<br>
    Generated by Type     : Not applicable
or not available<br>
   
Message              
: "Type201Lib.dll" was found but did not contain any components from
the input file.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>What is at
hand? Has anyone experience with implementing C++ components?<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>Another problem
is perhaps that I'm using Borland C++Builder, while the wizard generates a
makefile for VC. I've transformed the generated makefile type201.dsp with a
Borland tool vctobpr to a C++Builder project and compiled it. Anyone using
C++Builder?<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>Thanks for help<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin:0cm;margin-bottom:.0001pt'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>Henk<o:p></o:p></span></font></p>

</div>

</div>

</div>

</body>

</html>
<BR>
<BR>
 <BR>
 <BR>
************************************************************************************<BR>
This footnote confirms that this email message has been scanned by<BR>
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.<BR>
************************************************************************************<BR>
<BR>
<BR>

<BR>
<BR>
 <BR>
 <BR>
************************************************************************************<BR>
This footnote confirms that this email message has been scanned by<BR>
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.<BR>
************************************************************************************<BR>
<BR>
<BR>