C++ (Qt)// .hclass AxRoll : public QMainWindow, public QAxBindable// .cpp#include <QAxFactory>QAXFACTORY_DEFAULT(AxRoll, "{FD11A5A4-B433-49e1-A0E5-40496D16EC0B}", "{D1A36ABB-16AE-4cd1-BAEE-D7C77F1F80EA}", "{4CD7F9AF-BDAC-4e21-A2C4-291102674DF8}", "{DD5F39F0-AA74-4441-8F4E-A1E26F97A88A}", "{CB2FD6FF-E56A-4e76-ABE4-741066BF70AA}") AxRoll::AxRoll(QWidget * w): QMainWindow(w){ setCentralWidget(new QLabel("TEST LABEL", this));}
CONFIG += dll qaxserver
C++ (Qt){ QAxWidget * rollWidget = new QAxWidget; rollWidget->setControl("{FD11A5A4-B433-49e1-A0E5-40496D16EC0B}"); rollWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QVBoxLayout * vl = new QVBoxLayout; vl->setSizeConstraint(QLayout::SetMinAndMaxSize); vl->addWidget(rollWidget); setLayout(vl);}
C++ (Qt)MainWindow::MainWindow(QWidget * parent): QMainWindow(parent){ QAxWidget * wid = new QAxWidget; wid->setControl("{E437F37D-53BC-4d2c-97BD-31BC413204F9}"); wid->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setCentralWidget(wid);}
C++ (Qt)MainWindow::MainWindow(QWidget * parent): QMainWindow(parent){ setCentralWidget(new QWidget(this));}//некий slotvoid MainWindow::newFile(){ QAxWidget * wid = new QAxWidget; wid->setControl("{E437F37D-53BC-4d2c-97BD-31BC413204F9}"); wid->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); wid->show();}
class MainWindow: public QMainWindow{pablic: QAxWidget *wid;}/*тили, тили, трали-вали: создали, вызвали*/MainWindow::~MainWindow( delete wid;)
C++ (Qt)void MainWindow::newFile(){ QAxWidget * wid = new QAxWidget( this ); ...}
HEAP[ActiveQtClient_d.exe]: Invalid Address specified to RtlValidateHeap( 00B20000, 0012FE98 )Windows has triggered a breakpoint in ActiveQtClient_d.exe.This may be due to a corruption of the heap, and indicates a bug in ActiveQtClient_d.exe or any of the DLLs it has loaded.