title: Error when compiling C code with CreateEvent call
body: <p>I get several compile errors if I compile the following function in Visual Studio 2005:</p>
  
  <pre><code>void search()
  {
      deviceEventHandle = CreateEvent(NULL, FALSE, FALSE, "foundDevice");
  
      BTUINT32 deviceClass = 0; // 0 represents all classes 
      BTUINT16 maxDevices = 200; // 0 represents an unlimited number of responses
      BTUINT16 maxDuration = 45; // maxDuration * 1.28 = number of seconds
      Btsdk_StartDeviceDiscovery(deviceClass, maxDevices, maxDuration);
  
      WaitForSingleObject(deviceEventHandle, INFINITE);
  
      if (deviceEventHandle != NULL) {
          CloseHandle(deviceEventHandle);
          deviceEventHandle = NULL;
      }
  }
  </code></pre>
  
  <p>These are the errors I get:</p>
  
  <pre><code>error C2275: 'BTUINT32' : illegal use of this type as an expression 
  error C2146: syntax error : missing ';' before identifier 'deviceClass'     
  error C2065: 'deviceClass' : undeclared identifier
  error C2275: 'BTUINT16' : illegal use of this type as an expression     
  error C2146: syntax error : missing ';' before identifier 'maxDevices'      
  error C2065: 'maxDevices' : undeclared identifier   
  error C2275: 'BTUINT16' : illegal use of this type as an expression     
  error C2146: syntax error : missing ';' before identifier 'maxDuration'     
  error C2065: 'maxDuration' : undeclared identifier  
  </code></pre>
  
  <p>If I comment out the line containing the CreateEvent call the code compiles without errors:</p>
  
  <pre><code>void search()
  {
      //deviceEventHandle = CreateEvent(NULL, FALSE, FALSE, "foundDevice");
  
      BTUINT32 deviceClass = 0; // 0 represents all classes 
      BTUINT16 maxDevices = 200; // 0 represents an unlimited number of responses
      BTUINT16 maxDuration = 45; // maxDuration * 1.28 = number of seconds
      Btsdk_StartDeviceDiscovery(deviceClass, maxDevices, maxDuration);
  
      WaitForSingleObject(deviceEventHandle, INFINITE);
  
      if (deviceEventHandle != NULL) {
          CloseHandle(deviceEventHandle);
          deviceEventHandle = NULL;
      }
  
  
  }
  </code></pre>
  
  <p>These are the headers I use:</p>
  
  <pre><code>#include &lt;winsock2.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;conio.h&gt;
  #include "Btsdk_ui.h"
  </code></pre>
  
  <p>I compile the code as C code (/TC) in Visual Studio 2005. The "Btsdk_ui.h" file is part of the BlueSoleil bluetooth stack and inlcudes another file that contains definitions of BTUINT32 and BTUINT16.</p>
  
  <p>All suggestions are welcome.</p>