Problem Description : There is dll( A1.dll- compiled in C++) in which a function is defined as EXPORT void S3(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow){} I want to load this DLL using GO lang. For this I am writing below program:
package main
import (
"fmt"
"syscall"
"golang.org/x/sys/windows"
)
func main() {
dll, err := syscall.LoadDLL("A1.dll")
proc, err := dll.FindProc("S3")
_, _, dllError := proc.Call()
fmt.Println("calling S3")
fmt.Printf("Error, err: %s\n", dllError)
fmt.Printf("Error, err: %s\n", err)
}
This is not working. Also I am not able to understand that here how to pass the parameter in call function according to function S3 definition. Could anybody help me in understanding this issue?