#include <QtGui/QApplication>
#include <QString>
#include <QLineEdit>
#include "dialog.h"
#include <QLibrary>
#include <iostream>
#include <windows.h>
using namespace std;
char DLLfunction()
{
typedef char* (*MyPrototype)();
MyPrototype myFunction =
(MyPrototype
) QLibrary::resolve("dllprog",
"TestDll");
char b = myFunction();
return b;
}
int main(int argc, char *argv[])
{
ui.LineEdit->setText(qString);
Dialog w;
w.show();
return a.exec();
}
#include <QtGui/QApplication>
#include <QString>
#include <QLineEdit>
#include "dialog.h"
#include <QLibrary>
#include <iostream>
#include <windows.h>
using namespace std;
char DLLfunction()
{
QLibrary myLib("dllprog");
typedef char* (*MyPrototype)();
MyPrototype myFunction =
(MyPrototype) QLibrary::resolve("dllprog", "TestDll");
char b = myFunction();
return b;
}
QString qString(DLLfunction());
int main(int argc, char *argv[])
{
QString qString(DLLfunction());
ui.LineEdit->setText(qString);
QApplication a(argc, argv);
Dialog w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
this is my main.cpp code. This is the only page where I have written the code.
it says errors.
error: invalid conversion from `char*' to `char'
error: `ui' was not declared in this scope
warning: unused variable 'ui'
Bookmarks