Skip to content

Instantly share code, notes, and snippets.

View forderud's full-sized avatar

Fredrik Orderud forderud

View GitHub Profile
@forderud
forderud / QtYouTube.hpp,cpp
Last active February 15, 2024 16:40
YouTube video upload from Qt/C++
#pragma once
#include <QObject>
#include <QOAuth2AuthorizationCodeFlow>
/** YouTube video upload class.
Require API key & OAuth 2.0 client ID from https://console.developers.google.com/apis/credentials */
class YouTube : public QObject {
Q_OBJECT
Q_PROPERTY(bool limited_auth MEMBER m_limited_auth)
Q_PROPERTY(QString api_file MEMBER m_api_file)
#pragma once
#include <Windows.h>
#include <atlbase.h>
/** Programmatically creates an instance of a a COM object found in a specific DLL.
Confirmed to work with UWP if the DLL is placed in the same "AppX" folder as the UWP app.
WARNING: Will _leak_ handle to the DLL to avoid premature DLL unloading. The good
way to handle this would be to also return a RAII wrapper of the DLL handle, and