Passing binary data from Qt/C++ DLL into Delphi host application
问题 In a Program I want to uses QImage.bits() in Delphi. So, in Qt I was created a dll. the dll Source Code Listed in below: test.h: #ifndef TEST_H #define TEST_H #include "test_global.h" extern "C"{ TESTSHARED_EXPORT uchar* testFunc(); } #endif // TEST_H test.cpp: #include "test.h" #include <QtGui> QImage image; uchar* testFunc(){ image.load("c:\\1.png","PNG"); return (uchar*)image.constBits(); } and in the Delphi Side I use this code for using Qt dll: function testFunc(): PByteArray; external