roapi | Create full-fledged APIs | SQL Database library
kandi X-RAY | roapi Summary
kandi X-RAY | roapi Summary
ROAPI automatically spins up read-only APIs for static datasets without requiring you to write a single line of code. It builds on top of Apache Arrow and Datafusion. The core of its design can be boiled down to the following:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of roapi
roapi Key Features
roapi Examples and Code Snippets
Community Discussions
Trending Discussions on roapi
QUESTION
Whereas many Windows API functions exist in Windowsapp.lib
or in API sets (see this answer to How to declare and link to RoInitialize,RoUninitialize,RoGetActivationFactory and HSTRING Functions in Mingw Gcc), many functions are not listed as included in WindowsApp.lib or in the extension APIs.
For example, timeBeginPeriod
, which I want to use to set the resolution for Sleep
.
It is part of Timeapi
, which is not mentioned anywhere in the list of functions available in WindowsApp.lib or extension APIs. The documentation also does not mention any API set.
- Do I link to
winmm.lib
andwinmm.dll
? - Do I include
Windows.h
ortimeapi.h
?
How would I know? RoInitialize does not mention a DLL or an API set, but it is available in several.
...ANSWER
Answered 2021-Apr-19 at 19:32I figured I'd look into this myself. I wrote a little test program and used the VS compiler to test.
- Via Start, I launched a VS developer prompt (among other ways of doing that like in the answer to Run cl.exe from cmd ).
- I wrote up some simple programs to test the various cases.
My experimentation showed that the answer to this question is not necessarily straightforward:
- Do I link to
winmm.lib
andwinmm.dll
?
You may link/consume winmm
, but windowsapp.lib
is also sufficient, even though it is not documented that the time API functions are part of it.
- Do I include
Windows.h
ortimeapi.h
?
At least in my experimentation, Windows.h
was actually required to use timeBeginPeriod
. timeapi.h
was not sufficient or necessary. It is unclear to me why that is the case.
Here's how I got this answer:
Compiling a simple programJust to prove things will compile:
QUESTION
As far as I understand, Windows Runtime is the new infrastructure through which Windows exposes its APIs. My question is simple: how can I use that from pure C code? I don't mind writing more code, I just want to understand how things link together.
Let's take for example the basic example Microsoft gives: https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-enhance. Specifically, "Modify a C++ Win32 project to use Windows Runtime APIs", there's an example that shows how to display a toast notification from an application. How do I translate that code to make use of it from a plain .c file?
I found some header files in C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt
, for example windows.ui.notifications.h
I think might be useful, but I don't know how I am supposed to use the things in there. On MSDN, no article talks about pure C, only various managed languages and projections for C++.
Please, this is more of an academic question. I have successfully used COM from C in the past and was pretty okay with it, but for this, I can't find any mention or article about it online.
Thank you.
Edit Now I have some code that executes successfully (resulting HRESULTs are S_OK) but no toast is shown. Any idea how to debug this? What could be failing after all? I haven't implemented the COM activator, since I have a similar PowerShell script that works with basically the same thing I have written in C. I am stuck and lost, maybe someone can help.
...ANSWER
Answered 2020-Dec-21 at 19:21I figured it out, eventually. The issue is, you have to wait a bit before terminating the process so that the COM threads have a chance to actually do the work and deliver the notification. The code posted above fully works, I will later post a revised version with only the absolutely necessary stuff. The way I solved it was by stripping out everything until the example app (https://github.com/microsoft/Windows-classic-samples/blob/master/Samples/DesktopToasts/CPP/DesktopToastsSample.cpp) had the same code as mine, and the only difference being the message queue which kept the example app alive after "sending" the request for the toast.
Also, if you are fine with the notification being able to only trigger a protocol, and for it not to contain any buttons, you can skip creating a shortcut in Start and just use the appid of another app. If you supply an appid that does not belong to any installed application, the toast won't have an icon, by the app name will be whatever you supplied. This is great for people developing extensions/add-ons to current applications who do not really need to clutter the Start menu with unnecessary shortcuts. Buttons require COM activation because unfortunately, but at least we have this.
And yes, you do not need an app manifest either. Now the question is what is the correct way to wait before terminating? I mean, of course Sleep(200);
is fine, but I am curious about the correct solution.
To get the app IDs for installed apps, type Get-StartApps
in PowerShell.
Edit: Here is working code which hopefully frees memory etc.
QUESTION
My goal is to use EmailMessage class to let users of my desktop app interact with the Windows Mail app on Windows 10. As a test I'm trying the following from a stock C++ console app in Visual Studio 2017:
...ANSWER
Answered 2020-Feb-11 at 23:14you got REGDB_E_CLASSNOTREG
Class not registered because "Windows.ApplicationModel.Email" really not registered. ( look under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId
key - no Windows.ApplicationModel.Email
subkey here )
you have 2 errors in code, instead self string "Windows.ApplicationModel.Email" - you need use RuntimeClass_*
strings defined in some winrt header file. you need use
RuntimeClass_Windows_ApplicationModel_Email_EmailMessage
which is declared in Windows.ApplicationModel.email.h
then RoGetActivationFactory
can not return IEmailMessage
direct. it can return IActivationFactory
interface (You can get an IActivationFactory
pointer by calling the RoGetActivationFactory
function. ) and then you need call IActivationFactory::ActivateInstance
for get pointer to IInspectable
and finally QueryInterface
on it for get IEmailMessage
so better (if you need single instance of IEmailMessage
) use RoActivateInstance
here. code can be next
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install roapi
Spin up APIs for test_data/uk_cities_with_headers.csv and test_data/spacex_launches.json:.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page