title: Dynamically load user32.dll from R & call external function
body: <p>I try to access user32.dll  functions in R Session. I used the code:</p>
  
  <pre><code>dyn.load("c://windows//system32//user32.dll")
  .External("MessageBeep", 0L)
  </code></pre>
  
  <p>But R session crashes. According to documentation <code>.External</code> is intended to use during R package creation. However there was no prohibition to use it as shown above. </p>
  
  <p>I am using Windows 8 and RStudio (1.1.453) / R (3.5.0). Could you advise a proper way to call external Windows functions from R session?</p>