title: Strange behavior in Library API call (NET and  C++)
body: <p>I have a thirt pary API. It simply stream media to given ip-port(read media from a capture device).</p>
  
  <p>When I use that API in a Windows Form Application, it works. But when i call this API in a Console or Windows Service, it does not give any error but does not work[ does not stream ]: It seems that it does not take stream data from device.</p>
  
  <p>The only difference betwween is that One Applications is Windows Form Application, the other is not..
  There is really no difference other than this.</p>
  
  <p><strong>What kind of dependency may cause such a thing? Any idea ?</strong></p>
  
  <p><em>PS: The API is written in C++. I use that API in NET(C++/CLI)</em></p>
  
  <p>For Example:</p>
  
  <pre><code>// Works in Windows Form Application
  
  System::Void startButton_Click(System::Object^  sender, System::EventArgs^  e) 
  {
  
      MyAPI-&gt;Start();
  }
  System::Void stopButton_Click(System::Object^  sender, System::EventArgs^  e) 
  {
      MyAPI-&gt;Stop();
  }
  </code></pre>
  
  <p>but ....</p>
  
  <pre><code>// Not Work In Console or Windows Service
  
   MyAPI-&gt;Start();
  
   Console::WriteLine("Streaming started.Press enter to exit");
   Console::Read();
  
   MyAPI-&gt;Stop();
  
  Console::WriteLine("Streaming stopped");
  </code></pre>