csx 4 years ago
parent
commit
7ff25e5880
1 changed files with 1 additions and 3 deletions
  1. 1 3
      controllers/sg/his_api_controller.go

+ 1 - 3
controllers/sg/his_api_controller.go View File

2
 
2
 
3
 // #include <stdio.h>
3
 // #include <stdio.h>
4
 // #include <stdlib.h>
4
 // #include <stdlib.h>
5
-//extern void Init();
6
-//extern void ReadCardBas();
7
 import "C"
5
 import "C"
8
 
6
 
9
 import (
7
 import (
98
 	result := int(ret)
96
 	result := int(ret)
99
 	fmt.Println("SSCard的运算结果为1:", result)
97
 	fmt.Println("SSCard的运算结果为1:", result)
100
 
98
 
101
-	ret2, _, err2 := readCard.Call(cs1, IntPtr(1024), cs2, IntPtr(1024))
99
+	ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(&cs1)), IntPtr(1024), (uintptr)(unsafe.Pointer(&cs2)), IntPtr(1024))
102
 	fmt.Println(" Add(4,5)的结果为:", ret2)
100
 	fmt.Println(" Add(4,5)的结果为:", ret2)
103
 	fmt.Println(" str:", cs1)
101
 	fmt.Println(" str:", cs1)
104
 	fmt.Println(" str1:", cs2)
102
 	fmt.Println(" str1:", cs2)