mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-21 06:45:32 -06:00
Let native callbacks be defined in shared libraries.
This commit is contained in:
parent
90704aa526
commit
3ccc077406
2 changed files with 6 additions and 1 deletions
|
|
@ -18,9 +18,11 @@
|
|||
#define HOSTFXR_DLL_NAME "libhostfxr.so"
|
||||
#endif
|
||||
|
||||
static QString nativeModule;
|
||||
|
||||
static void* getExportedFunction(const char* symbolName) {
|
||||
#ifdef _WIN32
|
||||
HMODULE library = GetModuleHandle(nullptr);
|
||||
HMODULE library = GetModuleHandle(nativeModule.toLocal8Bit());
|
||||
FARPROC symbol = GetProcAddress(library, symbolName);
|
||||
return (void*)symbol;
|
||||
#else
|
||||
|
|
@ -132,6 +134,8 @@ CoreHost::HostFxrContext CoreHost::findHostFxr()
|
|||
|
||||
int CoreHost::run(QGuiApplication& app, QQmlApplicationEngine& engine, runCallback runCallback, RunContext runContext)
|
||||
{
|
||||
nativeModule = runContext.nativeModule;
|
||||
|
||||
QList<QString> execArgs;
|
||||
execArgs.push_back(runContext.entryPoint);
|
||||
execArgs.push_back("exec");
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public:
|
|||
QString entryPoint;
|
||||
QString managedExe;
|
||||
QList<QString> args;
|
||||
QString nativeModule;
|
||||
};
|
||||
|
||||
enum LoadHostFxrResult
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue