質問編集履歴
1
変数名変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,41 +26,41 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
void TEST::SetPtr
|
29
|
+
void TEST::SetPtr(IntPtr WPtrP)
|
30
30
|
|
31
31
|
{
|
32
32
|
|
33
|
-
StructTest
|
33
|
+
StructTest P;
|
34
34
|
|
35
|
-
|
35
|
+
P.a = 1;
|
36
36
|
|
37
|
-
|
37
|
+
P.b = 2;
|
38
38
|
|
39
|
-
|
39
|
+
P.c = 3;
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
-
WPtr
|
43
|
+
WPtrP = (IntPtr)&P;
|
44
44
|
|
45
45
|
}
|
46
46
|
|
47
47
|
|
48
48
|
|
49
|
-
void TEST::ChkPtr
|
49
|
+
void TEST::ChkPtr(IntPtr WPtrP)
|
50
50
|
|
51
51
|
{
|
52
52
|
|
53
|
-
StructTest*
|
53
|
+
StructTest* P;
|
54
54
|
|
55
|
-
SetTempPtrToPointer(WPtr
|
55
|
+
SetTempPtrToPointer(WPtrP, P);
|
56
56
|
|
57
57
|
|
58
58
|
|
59
|
-
int ia =
|
59
|
+
int ia = P->a;
|
60
60
|
|
61
|
-
int ib =
|
61
|
+
int ib = P->b;
|
62
62
|
|
63
|
-
int ic =
|
63
|
+
int ic = P->c;
|
64
64
|
|
65
65
|
}
|
66
66
|
|
@@ -74,9 +74,9 @@
|
|
74
74
|
|
75
75
|
IntPtr WIntPtrTest = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(8));
|
76
76
|
|
77
|
-
TEST.SetPtr
|
77
|
+
TEST.SetPtr(WIntPtrTest);
|
78
78
|
|
79
|
-
TEST.ChkPtr
|
79
|
+
TEST.ChkPtr(WIntPtrTest);
|
80
80
|
|
81
81
|
|
82
82
|
|