<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rɘɘ7</title>
	<atom:link href="http://ree7.fr/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://ree7.fr/blog</link>
	<description>serious business or what ?</description>
	<lastBuildDate>Fri, 13 Aug 2010 06:36:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>[SL/WP7] Snippet nprop</title>
		<link>http://ree7.fr/blog/?p=35</link>
		<comments>http://ree7.fr/blog/?p=35#comments</comments>
		<pubDate>Thu, 12 Aug 2010 18:00:37 +0000</pubDate>
		<dc:creator>Pierre Belin</dc:creator>
				<category><![CDATA[Dev']]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[NotifyPropertyChanged]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://ree7.fr/blog/?p=35</guid>
		<description><![CDATA[Avouez-le, vous en avez plein vos DataContext, des propriétés bêtes et méchantes qui font appel à une fonction NotifyPropertyChanged. [ Pour ceux du fond près du radiateur, dans une UI Silverlight, l'objet contexte de la page, s'il implémente INotifyPropertyChanged, possède un event PropertyChanged qui permet de signifier à Silverlight que de la valeur d'une propriété]]></description>
			<content:encoded><![CDATA[<p><a href="http://ree7.fr/blog/wp-content/uploads/2010/08/nprop.png"><img class="aligncenter size-full wp-image-36" title="Snippet nprop" src="http://ree7.fr/blog/wp-content/uploads/2010/08/nprop.png" alt="" width="544" height="239" /></a><br />
Avouez-le, vous en avez plein vos DataContext, des propriétés bêtes et méchantes qui font appel à une fonction NotifyPropertyChanged. [ Pour ceux du fond près du radiateur, dans une UI Silverlight, l'objet contexte de la page, s'il implémente INotifyPropertyChanged, possède un event PropertyChanged qui permet de signifier à Silverlight que de la valeur d'une propriété à changé et qu'il est temps de mettre à jour les éléments de l'UI attachés à cette propriété. ]</p>
<p>Nativement, dans Visual Studio nous avons à notre disposition <strong>prop</strong> et <strong>propdp</strong>, bien utiles dans la vie de tous les jours du développeur Silverlight pour créer propriétés et <em>DependencyProperties </em>sans trop avoir à taper du code purement répétitif. Par contre rien pour les propriétés déclenchant l&#8217;évènement <em>PropertyChanged </em>- sans doute car l&#8217;implémentation concrète d&#8217;<em>INotifyPropertyChange</em>d est laissée au développeur&#8230; bien que l&#8217;on fasse quasiement tous pareil.</p>
<p>Pour palier à ce manque je vous propose <strong>nprop, </strong>un snippet venant s&#8217;ajouter à votre IDE et qui vous permettra du temps dans vos développements <img src='http://ree7.fr/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Elle s&#8217;utilise comme n&#8217;importe quel autre snippet, tapez juste nprop puis TAB et le code apparaitra en vous invitant à remplir les trous.</p>
<ul>
<li><a href="http://ree7.fr/files/nprop/1_0_0/nprop.vsi">Fichier d&#8217;installation automatique .vsi</a></li>
<li><a href="http://ree7.fr/files/nprop/1_0_0/nprop.snippet">Fichier snippet nu</a> à placer dans votre dossier <em>%Documents%\Visual Studio 20xx\Code Snippets\Visual C#\My Code Snippets</em> au cas où le fichier précédent poserait problème</li>
</ul>
<img src="http://ree7.fr/blog/?ak_action=api_record_view&id=35&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://ree7.fr/blog/?feed=rss2&amp;p=35</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WP7] Missing CheckAccess()</title>
		<link>http://ree7.fr/blog/?p=30</link>
		<comments>http://ree7.fr/blog/?p=30#comments</comments>
		<pubDate>Mon, 10 May 2010 07:06:18 +0000</pubDate>
		<dc:creator>Pierre Belin</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[checkaccess]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://ree7.fr/blog/?p=30</guid>
		<description><![CDATA[Une petite note technique pour ceux qui se demandaient où était passée Dispatcher.CheckAccess() dans les CTP de Windows Phone 7. Cette primitive permet de savoir si le code courant tourne dans le thread d&#8217;UI ou pas, et donc si un BeginInvoke() est nécessaire ou pas. Exemple, pour récupérer un setting de l&#8217;IsolatedStorage depuis n&#8217;importe quel]]></description>
			<content:encoded><![CDATA[<p>Une petite note technique pour ceux qui se demandaient où était passée Dispatcher.CheckAccess() dans les CTP de Windows Phone 7.</p>
<p>Cette primitive permet de savoir si le code courant tourne dans le thread d&#8217;UI ou pas, et donc si un BeginInvoke() est nécessaire ou pas.</p>
<p>Exemple, pour récupérer un setting de l&#8217;IsolatedStorage depuis n&#8217;importe quel thread :</p>
<pre class="brush: csharp;">
public void GetSetting(string key, out object value)
        {
            if (Deployment.Current.Dispatcher.CheckAccess())
            {
                value = IsolatedStorageSettings.ApplicationSettings[key];
            }
            else
            {
                using (ManualResetEvent sync = new ManualResetEvent(false))
                {
                    object _value = null;

                    Deployment.Current.Dispatcher.BeginInvoke(() =&gt;
                        {
                            _value = IsolatedStorageSettings.ApplicationSettings[key];
                            sync.Set();
                        });

                    sync.WaitOne();
                    value = _value;
                }
            }
        }
</pre>
<p>Et bien CheckAccess() est toujours bien là dans la classe Dispatcher, même si l&#8217;Intellisense de Visual Studio ne vous la propose pas.</p>
<p><strong>Rappel : </strong>Pour les débutants en multi-threading sous Silverlight, le seul Dispatcher auquel vous avez accès depuis un autre thread que l&#8217;UI est Deployment.Current.Dispatcher. Si vous essayez de taper directement dans le Dispatcher d&#8217;un FrameworkElement vous irez tout droit à la CrossThreadException <img src='http://ree7.fr/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p>Source : <a href="http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/59d4b3ff-8944-4b63-a406-ab2011188be6/?prof=required">Forums MSDN</a></p>
<img src="http://ree7.fr/blog/?ak_action=api_record_view&id=30&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://ree7.fr/blog/?feed=rss2&amp;p=30</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ready-made usual flavour HttpWebRequest for Windows Phone 7</title>
		<link>http://ree7.fr/blog/?p=22</link>
		<comments>http://ree7.fr/blog/?p=22#comments</comments>
		<pubDate>Mon, 19 Apr 2010 20:54:28 +0000</pubDate>
		<dc:creator>Pierre Belin</dc:creator>
				<category><![CDATA[Sources]]></category>
		<category><![CDATA[getresponse]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[webrequest]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://ree7.fr/blog/?p=22</guid>
		<description><![CDATA[Si vous effectuez des portages d&#8217;applications .NET vers Silverlight ou Windows Phone 7, cette classe pourrait bien vous être utile. En effet, dans Silverlight, les WebRequests sont asynchrones (c&#8217;est très bien !), seulement ce changement d&#8217;API peut causer de nombreuses modifications de code. C&#8217;est dans cette optique que j&#8217;ai crée cette classe C# : HttpWebRequestSync]]></description>
			<content:encoded><![CDATA[<p>Si vous effectuez des portages d&#8217;applications .NET vers Silverlight ou Windows Phone 7, cette classe pourrait bien vous être utile.<br />
En effet, dans Silverlight, les WebRequests sont asynchrones (c&#8217;est très bien !), seulement ce changement d&#8217;API peut causer de nombreuses modifications de code. C&#8217;est dans cette optique que j&#8217;ai crée cette classe C# : HttpWebRequestSync qui propose une interface au plus proche de ce qui existait avant.</p>
<p>Attention, pour le coup vous perdrez l&#8217;avantage des requêtes asynchrones et votre thread appelant sera bloqué pendant le déroulement de la requête, comme au bon vieux temps !<br />
Tout retour de bug ou message de remerciement est le bienvenu, ce code est disponible sous licence LGPL.</p>
<p><em>If you&#8217;re looking forward to port .NET applications to Silverlight/Windows Phone 7, the following might interest you.<br />
In Silverlight, the WebRequests are asynchronous (and that&#8217;s a good thing), but this change in the API can cause numerous changes in your code. That&#8217;s what lead me to write this C# class : HttpWebRequestSync featuring an interface as close as possible as what was there before.</em></p>
<p><em>Note that you&#8217;ll lose the advantage of asynchronous requests and that you&#8217;re thread will be locked waiting for the request to complete, ol&#8217;school style.<br />
If you find any bug or just want to leave a &#8216;thank you&#8217; not you&#8217;re welcome. This code is available under the LGPL license.</em></p>
<p><span id="more-22"></span></p>
<pre class="brush: csharp;">/**********************************************************
 * HttpWebRequestSync.cs
 * Provides an implementation close to the .NET CF (3.5)
 * synchronous HttpWebRequest with Windows Phone 7's
 * asynchronous implementation.
 * TL;DR : Abstract the dev from all the async callback.
 *
 * Written by : Pierre BELIN &lt;pierre.belin@inbox.com&gt;
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the Lesser GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
 *
 **********************************************************/
using System;
using System.Net;
using System.Threading;
using System.IO;

namespace Ree7.Utils.Net
{
 public class HttpWebRequestSync
 {
 private ManualResetEvent getRequestDone = new ManualResetEvent(false);
 private ManualResetEvent getResponseDone = new ManualResetEvent(false);
 private HttpWebRequest request;

 private HttpWebResponse response;
 private Stream requestStream;

 /// &lt;summary&gt;
 /// Private ctor, to get an HttpWebRequestSync you shall use Create()
 /// &lt;/summary&gt;
 private HttpWebRequestSync()
 {

 }

 /// &lt;summary&gt;
 /// Initializes a new HttpWebRequestSync for the specified URI scheme
 /// &lt;/summary&gt;
 public static HttpWebRequestSync Create(string url)
 {
 return Create(new Uri(url));
 }

 /// &lt;summary&gt;
 /// Initializes a new HttpWebRequestSync for the specified URI scheme
 /// &lt;/summary&gt;
 public static HttpWebRequestSync Create(Uri uri)
 {
 HttpWebRequestSync wrs = new HttpWebRequestSync();
 wrs.request = (HttpWebRequest)WebRequest.Create(uri);

 return wrs;
 }

 #region HttpWebRequest Interface
 /// &lt;summary&gt;
 /// Summary:
 ///     Gets or sets the value of the Accept HTTP header.
 ///
 /// Returns:
 ///     The value of the Accept HTTP header. The default value is null.
 /// &lt;/summary&gt;
 public string Accept
 {
 get
 {
 return request.Accept;
 }
 set
 {
 request.Accept = value;
 }
 }
 /// &lt;summary&gt;
 /// Not Implemented Yet
 /// &lt;/summary&gt;
 public int ContentLength
 {
 get
 {
 return 0;
 }
 set
 {
 return;
 }
 }
 /// &lt;summary&gt;
 /// Summary:
 ///     Gets or sets the value of the Content-type HTTP header.
 ///
 /// Returns:
 ///     The value of the Content-type HTTP header. The default value is null.
 /// &lt;/summary&gt;
 public string ContentType
 {
 get
 {
 return request.ContentType;
 }
 set
 {
 request.ContentType = value;
 }
 }
 /// &lt;summary&gt;
 /// Summary:
 ///     Specifies the collection of System.Net.CookieCollection objects associated
 ///     with the HTTP request.
 ///
 /// Returns:
 ///     A System.Net.CookieContainer that contains a collection of System.Net.CookieCollection
 ///     objects associated with the HTTP request.
 ///
 /// Exceptions:
 ///   System.NotImplementedException:
 ///     This property is not implemented.
 /// &lt;/summary&gt;
 public CookieContainer CookieContainer
 {
 get
 {
 return request.CookieContainer;
 }
 set
 {
 request.CookieContainer = value;
 }
 }
 /// &lt;summary&gt;
 /// Summary:
 ///     Gets a value that indicates whether a response has been received from an
 ///     Internet resource.
 ///
 /// Returns:
 ///     true if a response has been received; otherwise, false.
 ///
 /// Exceptions:
 ///   System.NotImplementedException:
 ///     This property is not implemented.
 /// &lt;/summary&gt;
 public bool HaveResponse
 {
 get
 {
 return request.HaveResponse;
 }
 }
 /// &lt;summary&gt;
 /// Returns the underlying HttpWebRequest (handle it with care)
 /// &lt;/summary&gt;
 public HttpWebRequest HttpWebRequest
 {
 get
 {
 return request;
 }
 }
 /// &lt;summary&gt;
 /// Summary:
 ///     Specifies a collection of the name/value pairs that make up the HTTP headers.
 ///
 /// Returns:
 ///     A System.Net.WebHeaderCollection that contains the name/value pairs that
 ///     make up the headers for the HTTP request.
 ///
 /// Exceptions:
 ///   System.InvalidOperationException:
 ///     The request has been started by calling the System.Net.HttpWebRequest.BeginGetRequestStream

(System.AsyncCallback,System.Object)
 ///     or System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,System.Object)
 ///     method.
 /// &lt;/summary&gt;
 public WebHeaderCollection Headers
 {
 get
 {
 return request.Headers;
 }
 set
 {
 request.Headers = value;
 }
 }
 /// &lt;summary&gt;
 /// Summary:
 ///     Gets or sets the method for the request.
 ///
 /// Returns:
 ///     The request method to use to contact the Internet resource. The default value
 ///     is GET.
 ///
 /// Exceptions:
 ///   System.ArgumentException:
 ///     No method is supplied.-or- The method string contains invalid characters.
 ///
 ///   System.NotImplementedException:
 ///     This property is not implemented.
 ///
 ///   System.NotSupportedException:
 ///     The System.Net.HttpWebRequest.Method property is not GET or POST.
 /// &lt;/summary&gt;
 public string Method
 {
 get
 {
 return request.Method;
 }
 set
 {
 request.Method = value;
 }
 }
 /// &lt;summary&gt;
 /// Summary:
 ///     Gets the original Uniform Resource Identifier (URI) of the request.
 ///
 /// Returns:
 ///     A System.Uri that contains the URI of the Internet resource passed to the
 ///     System.Net.WebRequest.Create(System.Uri) method.
 ///
 /// Exceptions:
 ///   System.NotImplementedException:
 ///     This property is not implemented.
 /// &lt;/summary&gt;
 public Uri RequestUri
 {
 get
 {
 return request.RequestUri;
 }
 }
 #endregion

 public Stream GetRequestStream()
 {
 // start the asynchronous operation
 request.AllowReadStreamBuffering = false;
 request.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback), request);

 // Keep the main thread from continuing while the asynchronous
 // operation completes. A real world application
 // could do something useful such as updating its user interface.
 getRequestDone.WaitOne();

 Stream result = requestStream;

 // Avoid keeping an unnecessary ref on the stream in this object
 requestStream = null;

 return result;
 }

 private void GetRequestStreamCallback(IAsyncResult asynchronousResult)
 {
 request = (HttpWebRequest)asynchronousResult.AsyncState;
 requestStream = request.EndGetRequestStream(asynchronousResult);

 getRequestDone.Set();
 }

 public HttpWebResponse GetResponse()
 {
 // Start the asynchronous operation to get the response
 request.BeginGetResponse(new AsyncCallback(GetResponseCallback), request);

 getResponseDone.WaitOne();

 HttpWebResponse result = response;

 // Avoid keeping an unnecessary ref on the response in this object
 response = null;

 return result;
 }

 private void GetResponseCallback(IAsyncResult asynchronousResult)
 {
 request = (HttpWebRequest)asynchronousResult.AsyncState;

 // End the operation
 response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);

 getResponseDone.Set();
 }

 }
}</pre>
<img src="http://ree7.fr/blog/?ak_action=api_record_view&id=22&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://ree7.fr/blog/?feed=rss2&amp;p=22</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Faire discuter C# et C/C++ (et d&#8217;autres)</title>
		<link>http://ree7.fr/blog/?p=9</link>
		<comments>http://ree7.fr/blog/?p=9#comments</comments>
		<pubDate>Fri, 10 Apr 2009 05:21:35 +0000</pubDate>
		<dc:creator>Pierre Belin</dc:creator>
				<category><![CDATA[Dev']]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[DLLImport]]></category>
		<category><![CDATA[Marshalling]]></category>
		<category><![CDATA[PInvoke]]></category>

		<guid isPermaLink="false">http://ree7.fr/blog/?p=9</guid>
		<description><![CDATA[Cette exception m&#8217;a donné un peu de fil à retordre, je vais donc partager ma solution avec vous. Dans le cadre d&#8217;un projet C#, il arrive qu&#8217;on ait besoin d&#8217;utiliser des libraires (.DLL) non managées. Pour l&#8217;impétrant ce n&#8217;est pas forcément une balade de santé&#8230;  même en demandant à Google. La documentation MSDN est un]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-11" title="Arrrgh !" src="http://ree7.fr/blog/wp-content/uploads/2009/04/01.png" alt="Arrrgh !" width="451" height="232" /></p>
<p style="text-align: left;">Cette exception m&#8217;a donné un peu de fil à retordre, je vais donc partager ma solution avec vous.<br />
Dans le cadre d&#8217;un projet C#, il arrive qu&#8217;on ait besoin d&#8217;utiliser des libraires (.DLL) non managées. Pour l&#8217;impétrant ce n&#8217;est pas forcément une balade de santé&#8230;  même en demandant à Google.<br />
La documentation MSDN est un peu fouillis et on clique de lien en lien sans vraiment trouver de quoi se dépêtrer.</p>
<p style="text-align: left;">Je ne prétends pas que la solution que je vais vous proposer est la meilleure <em>(si des experts veulent réagir, vous êtes les bienvenus)</em>, mais elle à le mérite de fonctionner.</p>
<p style="text-align: left;">Ma problématique était la suivante : <strong>&laquo;&nbsp;J&#8217;ai trouvé un source C++ génial sur le net qui fait exactement ce que je veux, et j&#8217;aimerais l&#8217;utiliser dans mon application C#.&nbsp;&raquo;<br />
</strong></p>
<p style="text-align: left;">Ceci dit cet article peut vous aider si vous cherchez simplement à utiliser une DLL quelconque en C# (sautez à l&#8217;étape deux).</p>
<p style="text-align: left;"><span id="more-9"></span></p>
<ul>
<li>
<h2>Etape 1 (facile) : Je fais quoi de mon source C++ ?</h2>
<p>Vous m&#8217;aurez vu venir de loin&#8230; pour utiliser notre fameux code C++ nous allons créer une DLL.<br />
Pour cela, il faut créer un nouveau projet C++ au sein de la solution :</p>
<ul>
<li>Visual C++, Win32 Console Application, puis cocher DLL et Empty project dans l&#8217;assistant de création</li>
</ul>
<p>Ensuite, on importe les sources dans VC++ (je pars du principe que vous savez utiliser C++ et VC++, le cas échéant, vous devriez trouver moult aide sur le net).</p>
<p>Enfin on ajoute au projet C++ un .h et .cpp pour l&#8217;interface de notre DLL. Dans ce fichier on déclare (.h) et écrit (.cpp) les fonctions que l&#8217;on souhaite exposer dans la DLL (aka, utiliser depuis C#).</p>
<p>Cela peut être simplement des appels vers les fonctions qui vous interessent dans le code C++ ou, et là est l&#8217;intérêt, des fonctions qui machent un peu le travail avant de passer la main à C#.<br />
Pourquoi donc ? Car l&#8217;on ne peut exporter une classe de C++ vers .Net, car pour l&#8217;instant, le framework ne supporte pas <a href="http://www.programmersheaven.com/2/Calling-conventions" target="_blank">__thiscall</a>. Il va donc falloir se contenter de fonctions échangeant :</p>
<ul>
<li>Des types simples (bool, int, double&#8230;)</li>
<li>Des pointeurs</li>
<li>Des structs</li>
</ul>
<p><strong>Pour déclarer une fonction exportée dans la DLL</strong>, il suffit de faire précéder sa déclaration (dans le .h donc) de :  __declspec(dllexport)</p>
<p>Voici en exemple, un bout de mon code, brut de décoffrage. Je cherche à utiliser une classe : <em>voronoicell</em>, je vais donc l&#8217;instancier dans ma DLL en tant variable globale statique (car je ne peux pas la manipuler en C#, du moins pas de façon simple), puis les fonctions que j&#8217;expose dans la DLL me permettent de jouer avec la-dite instance de classe.</p>
<p>Fichier dllinterface.h</p>
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>JA</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="&#45;-" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:"MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4; 	mso-font-alt:"ＭＳ 明朝"; 	mso-font-charset:128; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:Consolas; 	panose-1:2 11 6 9 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610611985 1073750091 0 0 159 0;} @font-face 	{font-family:"\@MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4; 	mso-font-charset:128; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610612033 1757936891 16 0 131231 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"MS Mincho"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"MS Mincho"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> <mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Tableau Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --> <!--[endif]--></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: blue;">#ifndef</span><span style="font-size: 10pt; font-family: Consolas;"> _VORO_DLL_INTERFACE_<br />
</span><span style="font-size: 10pt; font-family: Consolas; color: blue;">#define</span><span style="font-size: 10pt; font-family: Consolas;"> _VORO_DLL_INTERFACE_</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: green;">/*</span><span style="font-size: 10pt; font-family: Consolas; color: green;"><br />
* Voro++ DLL Interface</span><span style="font-size: 10pt; font-family: Consolas; color: green;"> * ====================</span><span style="font-size: 10pt; font-family: Consolas; color: green;"> * Port of the library Voro++ (only basic functions) as a DLL file, exposing some basics features.</span><span style="font-size: 10pt; font-family: Consolas; color: green;"><br />
* Made in order to be integrated in a C# project.</span><span style="font-size: 10pt; font-family: Consolas; color: green;"><br />
*</span><span style="font-size: 10pt; font-family: Consolas; color: green;"><br />
* Author : Pierre BELIN, 2009.<br />
*/</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: green;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: blue;">namespace</span><span style="font-size: 10pt; font-family: Consolas;"> VoroDLL<br />
{<br />
extern &laquo;&nbsp;C&nbsp;&raquo;<br />
{</span><span style="font-size: 10pt; font-family: Consolas;"><span style="color: blue;"><br />
__declspec</span>(<span style="color: blue;">dllexport</span>) <span style="color: blue;">void</span> SCAInit(<span style="color: blue;">double</span> xmin, <span style="color: blue;">double</span> xmax, <span style="color: blue;">double</span> ymin, <span style="color: blue;">double</span> ymax, <span style="color: blue;">double</span> zmin, <span style="color: blue;">double</span> zmax);<br />
</span><span style="font-size: 10pt; font-family: Consolas;"><span style="color: blue;"> </span></span><span style="font-size: 10pt; font-family: Consolas; color: blue;" lang="FR">__declspec</span><span style="font-size: 10pt; font-family: Consolas;" lang="FR">(<span style="color: blue;">dllexport</span>) <span style="color: blue;">void</span> SCAPlane(<span style="color: blue;">double</span> x, <span style="color: blue;">double</span> y, <span style="color: blue;">double</span> z, <span style="color: blue;">double</span> rsq);<br />
</span><span style="font-size: 10pt; font-family: Consolas;"><span style="color: blue;"> </span></span><span style="font-size: 10pt; font-family: Consolas; color: blue;">__declspec</span><span style="font-size: 10pt; font-family: Consolas;">(<span style="color: blue;">dllexport</span>) <span style="color: blue;">void</span> SCACleanup(<span style="color: blue;">void</span>);<br />
}<br />
</span><span style="font-size: 10pt; font-family: Consolas;">}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: Consolas; color: blue;">#endif</span></p>
<p>Fichier dllinterface.cpp</p>
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>JA</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="&#45;-" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:"MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4; 	mso-font-alt:"ＭＳ 明朝"; 	mso-font-charset:128; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:Consolas; 	panose-1:2 11 6 9 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610611985 1073750091 0 0 159 0;} @font-face 	{font-family:"\@MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4; 	mso-font-charset:128; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610612033 1757936891 16 0 131231 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"MS Mincho"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"MS Mincho"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> <mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Tableau Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --> <!--[endif]--></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: blue;">#include</span><span style="font-size: 10pt; font-family: Consolas;"> <span style="color: #a31515;">&laquo;&nbsp;dllinterface.h&nbsp;&raquo;<br />
</span></span><span style="font-size: 10pt; font-family: Consolas; color: blue;">#include</span><span style="font-size: 10pt; font-family: Consolas;"> <span style="color: #a31515;">&laquo;&nbsp;voro++.cc.h&nbsp;&raquo;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: #a31515;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: green;">// Note : Compile with /EHsc /LD</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: green;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: blue;">namespace</span><span style="font-size: 10pt; font-family: Consolas;"> VoroDLL<br />
{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">static</span> voronoicell * SCA;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">void</span> SCAInit(<span style="color: blue;">double</span> xmin, <span style="color: blue;">double</span> xmax, <span style="color: blue;">double</span> ymin, <span style="color: blue;">double</span> ymax, <span style="color: blue;">double</span> zmin, <span style="color: blue;">double</span> zmax)<br />
{<br />
<span style="color: blue;">if</span>(SCA != NULL)<br />
<span style="color: blue;">delete</span> SCA;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span>SCA = <span style="color: blue;">new</span> voronoicell();<br />
</span><span style="font-size: 10pt; font-family: Consolas;" lang="FR">SCA-&gt;init((fpoint)xmin, (fpoint)xmax, (fpoint)ymin, (fpoint)ymax, (fpoint)zmin, (fpoint)zmax);<br />
}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;" lang="FR"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;" lang="FR"><span> </span><span style="color: blue;">void</span> SCAPlane(<span style="color: blue;">double</span> x, <span style="color: blue;">double</span> y, <span style="color: blue;">double</span> z, <span style="color: blue;">double</span> rsq)<br />
{<br />
SCA-&gt;plane((fpoint)x, (fpoint)y, (fpoint)z, (fpoint)rsq);<br />
</span><span style="font-size: 10pt; font-family: Consolas;">}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">void</span> SCACleanup(<span style="color: blue;">void</span>)<br />
{<br />
<span style="color: blue;">delete</span> SCA;<br />
}<br />
</span><span style="font-size: 10pt; line-height: 115%; font-family: Consolas;">}</span></p>
<p>Il ne reste plus qu&#8217;a compiler et linker tout ça pour obtenir une jolie petite DLL.</li>
</ul>
<ul>
<li>
<h2>Etape 2 : Et pour l&#8217;utiliser en C# ?<strong><br />
</strong></h2>
<p>C&#8217;est à cette étape que j&#8217;ai eu quelques soucis à faire quelque chose qui fonctionne à l&#8217;aide de la documentation.</p>
<p>Premièrement, pour ne pas se prendre la tête avec les chemins, car Visual Studio, ce gros malin, ne place pas les résultats d&#8217;un build C# et d&#8217;un build C++ d&#8217;une même solution dans les mêmes répertoires par défaut, il est de bon ton de régler le chemin de sortie de votre projet C# à la racine de votre solution.</p>
<ul>
<li>En Debug : VC# sors le projet dans -Solution-/-ProjetC#-/bin/x86/Debug, et VC++ dans -Solution-/Debug.</li>
<li>En Release : VC# sors le projet dans -Solution-/-ProjetC#-/bin/x86/Release, et VC++ dans -Solution-/Release.</li>
</ul>
<p>Changer les propriétés du projet C# pour une sortie dans ../Debug et ../Release fera l&#8217;affaire, et votre .exe C# se trouvera donc dans le même répertoire que votre .dll C++, ce qui épagnera des erreurs &laquo;&nbsp;Je trouve pas ta DLL mon coco&nbsp;&raquo; à l&#8217;exécution.</p>
<p>Ensuite pour utiliser une DLL non managée au sein de C#, il faut faire appel à DLLImport et au package System.Runtime.InteropServices;<br />
Personellement, j&#8217;ai écrit une classe qui &#8216;wrappe&#8217; ma DLL, voici ce que ça donne :</p>
<p>Fichier Voro++.cs :</p>
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>JA</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="&#45;-" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:"MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4; 	mso-font-alt:"ＭＳ 明朝"; 	mso-font-charset:128; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:Consolas; 	panose-1:2 11 6 9 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610611985 1073750091 0 0 159 0;} @font-face 	{font-family:"\@MS Mincho"; 	panose-1:2 2 6 9 4 2 5 8 3 4; 	mso-font-charset:128; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-1610612033 1757936891 16 0 131231 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"MS Mincho"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"MS Mincho"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> <mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Tableau Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --> <!--[endif]--></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas; color: blue;">using</span><span style="font-size: 10pt; font-family: Consolas;"> System;<br />
</span><span style="font-size: 10pt; font-family: Consolas; color: blue;">using</span><span style="font-size: 10pt; font-family: Consolas;"> System.Runtime.InteropServices;<br />
</span><span style="font-size: 10pt; font-family: Consolas; color: blue;">using</span><span style="font-size: 10pt; font-family: Consolas;"> System.Windows.Forms;</span></p>
<p><span style="font-size: 10pt; font-family: Consolas; color: blue;">namespace</span><span style="font-size: 10pt; font-family: Consolas;"> xxx.Analysis<br />
{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: gray;">///</span><span style="color: green;"> </span><span style="color: gray;">&lt;summary&gt;<br />
</span><span style="color: gray;">///</span><span style="color: green;"> Voro++ DLL Interface<br />
</span><span style="color: gray;">///</span><span style="color: green;"> ====================<br />
</span><span style="color: gray;">///</span><span style="color: green;"> Port of the library Voro++ (only basic functions) as a DLL file, exposing some basics features.<br />
</span><span style="color: gray;">///</span><span style="color: green;"> This library allows to compute Voronoi cells in a 3D space.<br />
</span><span style="color: gray;">///<br />
</span><span style="color: gray;">///</span><span style="color: green;"> Author : Pierre BELIN, 2009.<br />
</span><span style="color: gray;">///</span><span style="color: green;"> </span><span style="color: gray;">&lt;/summary&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">class</span> <span style="color: #2b91af;">VoroPP<br />
</span>{</span><span style="font-size: 10pt; font-family: Consolas;">[<span style="color: #2b91af;">DllImport</span>(<span style="color: #a31515;">"Voro++.dll"</span>, EntryPoint = <span style="color: #a31515;">"#2"</span>)]</span><span style="font-size: 10pt; font-family: Consolas;"><span style="color: blue;"><br />
private</span> <span style="color: blue;">static</span> <span style="color: blue;">extern</span> <span style="color: blue;">void</span> _Init(<span style="color: blue;">double</span> xmin, <span style="color: blue;">double</span> xmax, <span style="color: blue;">double</span> ymin, <span style="color: blue;">double</span> ymax, <span style="color: blue;">double</span> zmin, <span style="color: blue;">double</span> zmax);</span><span style="font-size: 10pt; font-family: Consolas;"><br />
[<span style="color: #2b91af;">DllImport</span>(<span style="color: #a31515;">"Voro++.dll"</span>, EntryPoint = <span style="color: #a31515;">"#3"</span>)]</span><span style="font-size: 10pt; font-family: Consolas;"><span style="color: blue;"><br />
private</span> <span style="color: blue;">static</span> <span style="color: blue;">extern</span> <span style="color: blue;">void</span> _Plane(<span style="color: blue;">double</span> x, <span style="color: blue;">double</span> y, <span style="color: blue;">double</span> z, <span style="color: blue;">double</span> rsq);<br />
[<span style="color: #2b91af;">DllImport</span>(<span style="color: #a31515;">"Voro++.dll"</span>, EntryPoint = <span style="color: #a31515;">"#1"</span>)]<br />
<span style="color: blue;">private</span> <span style="color: blue;">static</span> <span style="color: blue;">extern</span> <span style="color: blue;">void</span> _Cleanup();</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">void</span> Cleanup()<br />
{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">try<br />
</span>{<br />
_Cleanup();</span></p>
<p><span style="font-size: 10pt; font-family: Consolas;">}<br />
<span style="color: blue;">catch</span> (<span style="color: #2b91af;">Exception</span> e)<br />
{<br />
<span style="color: #2b91af;">MessageBox</span>.Show(<span style="color: #a31515;">&laquo;&nbsp;Error interacting with Voro++.dll : &laquo;&nbsp;</span> + e.Message, <span style="color: #a31515;">&laquo;&nbsp;DLL Error&nbsp;&raquo;</span>, <span style="color: #2b91af;">MessageBoxButtons</span>.OK, <span style="color: #2b91af;">MessageBoxIcon</span>.Error);<br />
<span style="color: #2b91af;">Application</span>.Exit();<br />
}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;" lang="FR"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;" lang="FR"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;" lang="FR"><span> </span><span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">void</span> Init(<span style="color: blue;">double</span> xmin, <span style="color: blue;">double</span> xmax, <span style="color: blue;">double</span> ymin, <span style="color: blue;">double</span> ymax, <span style="color: blue;">double</span> zmin, <span style="color: blue;">double</span> zmax)<br />
{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;" lang="FR"><span> </span><span style="color: blue;">try<br />
</span>{<br />
_Init(xmin, xmax, ymin, ymax, zmin, zmax);</span></p>
<p><span style="font-size: 10pt; font-family: Consolas;">}<br />
<span style="color: blue;">catch</span> (<span style="color: #2b91af;">Exception</span> e)<br />
{<br />
<span style="color: #2b91af;">MessageBox</span>.Show(<span style="color: #a31515;">&laquo;&nbsp;Error interacting with Voro++.dll : &laquo;&nbsp;</span> + e.Message, <span style="color: #a31515;">&laquo;&nbsp;DLL Error&nbsp;&raquo;</span>, <span style="color: #2b91af;">MessageBoxButtons</span>.OK, <span style="color: #2b91af;">MessageBoxIcon</span>.Error);<br />
<span style="color: #2b91af;">Application</span>.Exit();<br />
}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">void</span> Plane(<span style="color: blue;">double</span> x, <span style="color: blue;">double</span> y, <span style="color: blue;">double</span> z, <span style="color: blue;">double</span> rsq)<br />
{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: Consolas;"><span> </span><span style="color: blue;">try<br />
</span>{<br />
_Plane(x, y, z, rsq);<br />
}<br />
<span style="color: blue;">catch</span> (<span style="color: #2b91af;">Exception</span> e)<br />
{<br />
<span style="color: #2b91af;">MessageBox</span>.Show(<span style="color: #a31515;">&laquo;&nbsp;Error interacting with Voro++.dll : &laquo;&nbsp;</span> + e.Message, <span style="color: #a31515;">&laquo;&nbsp;DLL Error&nbsp;&raquo;</span>, <span style="color: #2b91af;">MessageBoxButtons</span>.OK, <span style="color: #2b91af;">MessageBoxIcon</span>.Error);<br />
<span style="color: #2b91af;">Application</span>.Exit();<br />
}</span></p>
<p>}</p>
<p>}</p>
<p>}</p>
<p class="MsoNormal">
<p>Vous l&#8217;aurez donc compris, pour faire appel à votre fonction exportée, il faut reprendre son prototype en la déclarant <span style="font-size: 10pt; font-family: Consolas;"><span style="color: blue;">static</span> <span style="color: blue;">extern</span></span> et en ajoutant le préfixe DLLImport : <span style="font-size: 10pt; font-family: Consolas;">[<span style="color: #2b91af;">DllImport</span>(<span style="color: #a31515;">"Ma DLL"</span>, EntryPoint = <span style="color: #a31515;">"Un numéro obscur ou le nom de la fonction"</span>)]</span></p>
<p>L&#8217;EntryPoint est sensé marcher avec les noms de fonctions automatiquement&#8230;<br />
Cependant, selon la façon dont à été codée la DLL que vous voulez utiliser, vous pouvez vous manger l&#8217;exception en tête d&#8217;article&#8230;<br />
La parade dans ce cas est d&nbsp;&raquo;appeler les fonctions via leur numéro ordinal, c&#8217;est plus moche mais ça fonctionne.</p>
<p>Pour trouver le numéro ordinal correspondant à votre fonction, il faut ouvrir la DLL avec laquelle vous voulez jouer avec un petit utilitaire, par exemple DLL Export Viewer :</p>
<p><img class="aligncenter size-full wp-image-14" title="DLL Export Viewer" src="http://ree7.fr/blog/wp-content/uploads/2009/04/02.png" alt="DLL Export Viewer" width="708" height="177" /><br />
Sinon, comme vous pouvez le voir, je n&#8217;utilise pas directement les fonctions de DLL, histoire de pouvoir prendre en compte les exceptions pouvant arriver lors de l&#8217;exécution, typiquement DLLNotFound et EntryPointNotFound.<br />
J&#8217;espère vous avoir épargné quelques moments de tâtonnements et frustration <img src='http://ree7.fr/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
<p>Plus d&#8217;infos :</p>
<ul>
<li>La plupart de ce qu&#8217;il faut savoir (en anglais), par Paul DiLascia : <a href="http://msdn.microsoft.com/en-us/magazine/cc301501.aspx" target="_blank">http://msdn.microsoft.com/en-us/magazine/cc301501.aspx</a></li>
</ul>
<img src="http://ree7.fr/blog/?ak_action=api_record_view&id=9&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://ree7.fr/blog/?feed=rss2&amp;p=9</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Attention au compilateur C-+ de Visual Studio 2008</title>
		<link>http://ree7.fr/blog/?p=3</link>
		<comments>http://ree7.fr/blog/?p=3#comments</comments>
		<pubDate>Thu, 05 Feb 2009 13:13:43 +0000</pubDate>
		<dc:creator>Pierre Belin</dc:creator>
				<category><![CDATA[Dev']]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[gaul]]></category>
		<category><![CDATA[linker]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://ree7.fr/blog/?p=3</guid>
		<description><![CDATA[Je ne suis pas un grand expert C/C++ mais j&#8217;ai eu affaire à une chose étrange aujourd&#8217;hui, qui m&#8217;aura couté (et à d&#8217;autres) de longues heures. Erreur de l&#8217;éditeur de lien : error LNK2019: unresolved external symbol &#171;&#160;short __cdecl ga_population_seed(struct population_t *)&#160;&#187; Le contexte, une solution C/C++ principalement écrite en C, dont deux des projets]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" src="http://img530.imageshack.us/img530/7097/16743275ql9.png" alt="" width="749" height="521" /></p>
<p>Je ne suis pas un grand expert C/C++ mais j&#8217;ai eu affaire à une chose étrange aujourd&#8217;hui, qui m&#8217;aura couté (et à d&#8217;autres) de longues heures.</p>
<p>Erreur de l&#8217;éditeur de lien : <strong>error LNK2019: unresolved external symbol &laquo;&nbsp;short __cdecl ga_population_seed(struct population_t *)&nbsp;&raquo;</strong></p>
<p>Le contexte, une solution C/C++ principalement écrite en C, dont deux des projets sont une librairies (sortie en .lib) C (GAUL : Genetic Algorithm Utility Library pour ne pas la citer).</p>
<p>La compilation se passe sans heurts (ceci dit, nous avons du modifier un petit peu la version soit disant Windows de GAUL pour qu&#8217;elle fonctionne sous VS2008 &#8211; <em>soucis de #define, etc&#8230; assez triviaux dans l&#8217;ensemble</em>). Mais le linking est une catastrophe, impossible pour VS de trouver les fonctions définies dans le header de notre librairie. Diantre !</p>
<p>Et bien le souci vient de la configuration du projet par défaut sous Visual Studio. En effet celui ci nous propose de choisir entre un compilateur C, et un compilateur C++, mais son choix par défaut semble être un étrange et indigeste mix des deux !</p>
<p><strong>Tentative d&#8217;explication :</strong></p>
<p>- Le compilateur par défaut (qui accepte de compiler sans broncher) doit déclarer nos fonctions (dans les .obj) d&#8217;une maniere differente de celle attendue par le linker ( __cdecl blah-blah-blah)</p>
<p><strong>La solution :</strong></p>
<p>- Forcer le compilateur a utiliser le compilateur C++ (ou C suivant votre convenance)</p>
<p>- Corriger les erreurs levées par le compilateur (et ca peut etre long, dans notre cas GAUL utilise moult attributions de pointeurs sans cast, déclare des fonctions s&#8217;appelant new ou delete, &#8230; &#8211; environ 300 erreurs au total chez nous).</p>
<p>Et voila, ça devrait linker correctement maintenant !</p>
<p>On remercie Ben pour avoir trouvé la solution !</p>
<img src="http://ree7.fr/blog/?ak_action=api_record_view&id=3&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://ree7.fr/blog/?feed=rss2&amp;p=3</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
