title: How to use COM (Component Object Model) in Golang
body: <p>I have a Windows DLL (XA_Session.dll) file but I don't know how to use it in golang.</p>
  
  <p>This is a DLL Viewer picture </p>
  
  <p><img src="https://i.stack.imgur.com/ppSY5.jpg" alt=""></p>
  
  <p>I want to use the <code>ConnectServer</code> COM Method.</p>
  
  <p>Here is my code</p>
  
  <pre><code>package main
  
  import (
      "syscall"
      "fmt"
  )
  
  var (
      mod = syscall.NewLazyDLL("XA_Session.dll")
      proc = mod.NewProc("DllGetClassObject")
  )
  
  func main() {
      var bConnect bool
      bConnect = proc.ConnectServer("hts.ebestsec.co.kr", 20001)
  
      if bConnect {
          fmt.Println("Success")
      } else {
          fmt.Println("Fail")
      }
  }
  </code></pre>
  
  <p>compile error: </p>
  
  <blockquote>
    <p>.\main.go:17: proc.ConnectServer undefined (type *syscall.LazyProc has no field or method ConnectServer)</p>
  </blockquote>