PDA

View Full Version : QT use DLL from VC6



youfulan2015
24th July 2015, 09:59
I got DLL build by vc6 ,here is the function inside:
#ifndef DLL_API
#define DLL_API extern "C" __declspec(dllimport)
#endif

#define WIN_API __stdcall

....................
DLL_API void WINAPI HTDrawTopPentagon(HDC hDC,int nCenterX,int nCenterY,COLORREF clr);
...................
in QT I want to use these funtions.
will it work if I program a QT project like this:
"
QLibrary myLib("dll_name");

typedef int (MyPrototype)(QPixmap ,int,int,QColor);
MyPrototype myFunction = (MyPrototype) myLib.resolve("HTDrawTopPentagon");
myFunction test;
will test work?
or should i typedef int (*MyPrototype)(HDC ,int,int,COLORREF);in QT?

anda_skoa
24th July 2015, 11:48
Any specific reason that you want to load the DLL at runtime?
Is it optional so that you can't link it at build time?

Cheers,
_