title: Byte array PAnsiChar in Delphi 2007
body: <p>I have a byte array with some data...</p>
  
  <pre><code>CommandBytes : array of byte;
  </code></pre>
  
  <p>And I have a function of a VCL that sends command to a bluetooth printer.
  The VCL function prototype is this</p>
  
  <pre><code>SendData(PAnsiChar, Cardinal);
  </code></pre>
  
  <p>"This method transmits bytes from the memory buffer into opened device"</p>
  
  <p>How could I pass correctly the byte array to function to send command to printer?</p>
  
  <p>I'm new to Delphi, I tried:</p>
  
  <pre><code>SendData(PAnsiChar(@CommandBytes[0]), SizeOf(CommandBytes));
  </code></pre>
  
  <p>but it doesn't work... </p>
  
  <p>Thanks in advance.</p>