I'm trying to get std::string/std::wstring returned value from connected DLL in Qt and I having problem with this.
code from DLL:
using namespace std;
extern "C++" __declspec(dllexport) string test()
{
return "Passed!";
}
code in my Qt application (Qt Creator):
typedef std::string (*Test)();
QLibrary *lib = new QLibrary("dllname");
lib->load();
.... dll load check ....
Test test = (Test) lib->resolve("test");
std::string s = test();
QString name = QString::fromStdString(s);
In result "name" variable will have "H" insted of "Passed!" What I'm doing wrong?
Thanks in advance