title: Build TagLib# DLL from source and make it COM Visible to PHP
body: <p>Hello I want to scan audio-video files and store their metadata in a database using php. I found this <a href="http://www.ohadsoft.com/2012/10/tagger-command-line-media-tagger-based-on-taglib/">Command-line wrapper</a> that uses <a href="http://download.banshee.fm/taglib-sharp/2.1.0.0/taglib-sharp-2.1.0.0-windows.zip">TagLib.dll compiled  by banshee developpers</a> to do the job. It's works fine but it limited by the functions implemented. I want to access directly to the dll methods via PHP.</p>
  
  <p>In PHP we have a function (<a href="http://php.net/manual/en/class.dotnet.php">DOTNET</a>) that allows me to instantiate a class from a .Net assembly and call its methods and access its properties like this :</p>
  
  <pre><code>/*$obj = new DOTNET("assembly", "classname");*/  
  
  $stack = new DOTNET("mscorlib", "System.Collections.Stack");
  $stack-&gt;Push(".Net");
  $stack-&gt;Push("Hello ");
  echo $stack-&gt;Pop() . $stack-&gt;Pop();
  
  //Returns string(10) "Hello .Net";
  </code></pre>
  
  <p><strong>Here is</strong> <a href="https://github.com/mono/taglib-sharp/">the Taglib# project sources in github</a> </p>
  
  <p>I saw many questions relatives to PHP-DLL-COM and there is some recommendations :</p>
  
  <ul>
  <li>Make the dll comVisible;  </li>
  <li>Register the dll with <code>regsvr32</code>;</li>
  <li>Use a module definition file similar to</li>
  </ul>
  
  <p>;</p>
  
  <pre><code>;
  
  DESCRIPTION     "Simple COM object"
  
  EXPORTS
                  DllGetClassObject       PRIVATE
                  DllCanUnloadNow         PRIVATE
                  DllRegisterServer       PRIVATE
                  DllUnregisterServer     PRIVATE
  </code></pre>
  
  <p>My question is : <strong><em>How can I build the DLL and use its method via PHP ?</em></strong></p>
  
  <p><strong>My config</strong> :</p>
  
  <ul>
  <li><p>OS</p>
  
  <blockquote>
    <p>Windows Server 2012 R2 Standard Edition i586</p>
  </blockquote></li>
  <li><p>Apache : </p>
  
  <blockquote>
    <p>Apache/2.2.21 (Win32) DAV/2 PHP/5.4.42 mod_ssl/2.2.21 OpenSSL/0.9.8r</p>
  </blockquote></li>
  <li><p>PHP</p>
  
  <blockquote>
    <p>PHP Version : 5.4.42<br>
    Arch : x86<br>
    Compiler : MSVC9 (Visual C++ 2008)<br>
    COM support : enabled<br>
    DCOM support : disabled<br>
    .Net support enabled</p>
  </blockquote></li>
  <li><p>Microsoft Visual Studio 2013</p></li>
  </ul>