title: com0com virtual port not found
body: <p>I have installed, apparently successfully, com0com v2.2.2.0 on a 64bit Windows 7 machine.</p>
  
  <p>I run the command utility, like this:</p>
  
  <pre><code>command&gt; install PortName=COM9 PortName=COM8
         CNCA0 PortName=COM9
         CNCB0 PortName=COM8
  ComDB: COM8 - logged as "in use"
  ComDB: COM9 - logged as "in use"
  
  command&gt; busynames COM?*
  COM3
  COM4
  COM5
  COM6
  COM8
  COM9
  COMPOSITEBATTERY
  </code></pre>
  
  <p>Note: <em>logged as "in use"</em> is NOT an error message? </p>
  
  <p>Then I try to open COM8 like this</p>
  
  <pre><code>m_hIDComDev = CreateFileA( szCodedPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL );
  if( m_hIDComDev == NULL  || m_hIDComDev == INVALID_HANDLE_VALUE ) {
  
      wchar_t * lpMsgBuf;
      DWORD dw = ::GetLastError(); 
      FormatMessage(
          FORMAT_MESSAGE_ALLOCATE_BUFFER | 
          FORMAT_MESSAGE_FROM_SYSTEM |
          FORMAT_MESSAGE_IGNORE_INSERTS,
          NULL,
          dw,
          MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
          (LPTSTR) &amp;lpMsgBuf,
          0, NULL );
  
      myErrorMsg = (char*)malloc( 200 );
      sprintf(myErrorMsg,"Error creating connection %s ( %s ) %S",
          szPort,szCodedPort,lpMsgBuf);
  </code></pre>
  
  <p>This fails with</p>
  
  <pre><code>Error creating connection COM8 ( COM8 ) The system cannot find the file specified.
  </code></pre>
  
  <p>I have tried both "COM8" and <code>"\\.\COM8"</code>.</p>
  
  <p>Note that the exact same call to CreateFileA works perfectly on a 'real' COM port.</p>
  
  <p>Q: Can someone tell me what the problem is?</p>
  
  <p>A: On windows 7 64 bit you have to enable testing of unsigned drivers.</p>
  
  <ul>
  <li><p>Run a command prompt as administrator.  ( It is not enough just to run from an account with admin privileges.  See <a href="http://www.softwx.com/weather/virtualvp/VirtualSerialPorts64bitHelp.pdf" rel="noreferrer">here</a> for details of how to do this. )</p></li>
  <li><p>Type in the command <code>bcdedit -set TESTSIGNING ON</code></p></li>
  <li><p>reboot.  ( Windows will place a "test Mode" note on the bottom right of the desktop )</p></li>
  </ul>
  
  <p>For Windows 8 this method does not work satisfactorily or easily.  Here is <a href="http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/" rel="noreferrer">some discussion</a> of the issues and workarounds.</p>
  
  <p>Alternatively you might want to try a <a href="https://code.google.com/p/powersdr-iq/downloads/detail?name=setup_com0com_W7_x64_signed.exe&amp;can=2&amp;q=" rel="noreferrer">signed version</a> - I have NOT tried this myself.</p>