56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
#include <QCoreApplication>
|
|
#include <QString>
|
|
#include <QDebug>
|
|
#include <QLibrary>
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "message_handler.h"
|
|
|
|
#include "calculator_c_interface_lib.h"
|
|
|
|
//#include "tariff_calculator.h"
|
|
|
|
typedef TariffCalculator *TariffCalculatorHandle;
|
|
|
|
typedef TariffCalculatorHandle (*NewTariffCalculatorFunc)();
|
|
typedef void (*DeleteTariffCalculatorFunc)(TariffCalculatorHandle handle);
|
|
|
|
//extern "C" {
|
|
//#include "calculator_c_interface_lib.h"
|
|
//bool __declspec(dllimport) initTariffEditor();
|
|
//}
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication a(argc, argv);
|
|
|
|
if (!messageHandlerInstalled()) {
|
|
atbInstallMessageHandler(atbDebugOutput);
|
|
//setDebugLevel(LOG_NOTICE);
|
|
}
|
|
|
|
QLibrary library("C:\\build-ATBTariffCalculator-Desktop_Qt_6_5_0_MinGW_64_bit-Release\\CalculatorCInterface\\release\\CalculatorCInterface.dll");
|
|
if (library.load()) {
|
|
qCritical() << "loaded";
|
|
NewTariffCalculatorFunc f = (NewTariffCalculatorFunc) library.resolve("NewTariffCalculator");
|
|
TariffCalculatorHandle handle = 0;
|
|
if (f) {
|
|
qCritical() << "resolved";
|
|
handle = f();
|
|
}
|
|
DeleteTariffCalculatorFunc d = (DeleteTariffCalculatorFunc) library.resolve("DeleteTariffCalculator");
|
|
if (d) {
|
|
qCritical() << "resolved";
|
|
d(handle);
|
|
}
|
|
}
|
|
|
|
|
|
//initTariffEditor();
|
|
|
|
|
|
return 0; // a.exec();
|
|
|
|
}
|