Textractor_test/GUI/misc.h
Akash Mozumdar f74cd553c0 refactor
2019-02-02 16:54:13 -05:00

9 lines
493 B
C++

#pragma once
#include "qtcommon.h"
struct QTextFile : QFile { QTextFile(const QString& name, QIODevice::OpenMode mode) : QFile(name) { open(mode | QIODevice::Text); } };
inline std::wstring S(const QString& S) { return { S.toStdWString() }; }
inline QString S(const std::wstring& S) { return QString::fromStdWString(S); }
inline HMODULE LoadLibraryOnce(std::wstring fileName) { if (HMODULE module = GetModuleHandleW(fileName.c_str())) return module; return LoadLibraryW(fileName.c_str()); }