diff options
| author | Yong He <yonghe@outlook.com> | 2022-08-03 12:08:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-03 12:08:37 -0700 |
| commit | e81a5fe56f3177fc3c7040e2320ae083e3746eb7 (patch) | |
| tree | 884c15287bc10050e7883897dd266b27e62bff66 /examples | |
| parent | 260fc5fbe58f2cf976d64993054c638769bc280f (diff) | |
Basic pointer usages. (#2342)
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/heterogeneous-hello-world/main.slang | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/heterogeneous-hello-world/main.slang b/examples/heterogeneous-hello-world/main.slang index 2a9c1eaf1..b852ca1a1 100644 --- a/examples/heterogeneous-hello-world/main.slang +++ b/examples/heterogeneous-hello-world/main.slang @@ -4,9 +4,9 @@ __target_intrinsic(cpp, "printf(\"%s\", ($0).getBuffer())") public void writeln(String text); [DllImport("User32")] -int MessageBoxA(Ptr<void> hwnd, String text, String caption, uint flags); +int MessageBoxA(void* hwnd, String text, String caption, uint flags); -[COM] +[COM("111702C2-2FD7-46F9-A318-DCCEEC96357E")] interface IObject { int getValue(int value) throws int; @@ -17,9 +17,8 @@ IObject createObject(); public __extern_cpp void main() throws int { - //writeln("hello world"); - //MessageBoxA(nullptr, "hello world!", "example", 0); - + writeln("hello world"); + MessageBoxA(nullptr, "hello world!", "example", 0); IObject object = createObject(); int rs = try object.getValue(2); |
