From 765061a77bcf4fe6300721263cc9e0f25595488d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 10 May 2022 19:42:48 -0700 Subject: Initial support for COM interface in host code. (#2230) Co-authored-by: Yong He Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com> --- examples/heterogeneous-hello-world/main.slang | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/heterogeneous-hello-world/main.slang b/examples/heterogeneous-hello-world/main.slang index 90f39fff7..2e65c7149 100644 --- a/examples/heterogeneous-hello-world/main.slang +++ b/examples/heterogeneous-hello-world/main.slang @@ -6,9 +6,23 @@ public void writeln(String text); [DllImport("User32")] int MessageBoxA(Ptr hwnd, String text, String caption, uint flags); +[COM] +interface IObject +{ + int getValue(int value); +} + +[DllImport("test-com")] +IObject createObject(); + public __extern_cpp int main() { - writeln("hello world"); - MessageBoxA(nullptr, "hello world!", "example", 0); + //writeln("hello world"); + //MessageBoxA(nullptr, "hello world!", "example", 0); + + IObject object = createObject(); + + int rs = object.getValue(2); + return 0; } \ No newline at end of file -- cgit v1.2.3