From e81a5fe56f3177fc3c7040e2320ae083e3746eb7 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 3 Aug 2022 12:08:37 -0700 Subject: Basic pointer usages. (#2342) --- examples/heterogeneous-hello-world/main.slang | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'examples') 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 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); -- cgit v1.2.3