#Is it possible to call WinRT APIs on Windows ?

1 messages · Page 1 of 1 (latest)

blazing lynx
opaque pond
#

umm does win32 call any windows apis ?will try so , thanks

#

sorry if i may ask but how to add it in zon ?

#

ah just found zig fetch , ty

#

am i doing it right ?

    const win32Zig = b.dependency("zigwin32", .{});
    exe.root_module.addImport("zigwin32", win32Zig.module("zigwin32"));

I'm getting

unable to find module

#

it's in the zon file

#

okay found module name it is win32 , works now , now gonna try

#

well nah as i expected I can't call api from WinRT from win32 apis

#

Is it possible to call WinRT APIs on Windows ?

flat void
#

WinRT is based on COM technology. It needs some magic. There is no zig library for that magic. So you need to do it manually: https://www.codeproject.com/articles/COM-in-C I haven't read that article, but from what I remember from 1999 when I last did COM. There is a tool for generating a C++ interface structure from interface-files. The interface files should be part of the SDK.

#

Microsoft made a rust COM library, maybe it is easier to write a wrapper in rust?

#

If there was a library it would probably be named zig-ATL (active template library) or zig-COM.

opaque pond
#

idk i just want to get the SMTC (SystemMediaTransportControls) so bad in my app but it's not related to zig , and its more in C++ A language i hate , if it was C , i would be happy to dive in and nah i dont like rust syntax so it will be hard for me to get wrapper

flat void
obsidian lava
#

just do COM manually if u only need that