@mrjj thank you for answer. I read that book but I did not get anything.
I do like this site and make an example: http://nickguthrie.com/embedd_gui/src/qt-everywhere-opensource-src-4.8.4/doc/html/activeqt-server.html
1- create widget application. (first made by console app but the Qt creator alert show it is not good in console app so I create widget app)
2- in .pro :
#-------------------------------------------------
#
# Project created by QtCreator 2016-08-20T12:52:04
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Test2ActiveXServer
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
test.cpp
HEADERS += mainwindow.h \
test.h
FORMS += mainwindow.ui
#this is make QAXserver
CONFIG += axserver
RC_FILE = qaxserver.rc
in main.cpp:
#include "mainwindow.h"
#include <QApplication>
#include <QAxFactory>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
if ( !QAxFactory::isServer() )
{
MainWindow w;
w.show();
}
return a.exec();
}
then create a class and its name is test.
test.h:
#ifndef TEST_H
#define TEST_H
#include <QObject>
#include <QAxBindable>
#include <QWidget>
#include <QAxFactory>
class test : public QObject , public QAxBindable
{
Q_OBJECT
Q_PROPERTY( int value READ value WRITE setValue )
QAXFACTORY_BEGIN("{3304a730-4230-4a82-ab61-334a2e93c803}",
"{23667206-d900-4f1a-a14f-30397fa5adc7}")
QAXCLASS(MyWidget)
QAXCLASS(MyWidget2)
QAXTYPE(MySubType)
QAXFACTORY_END()
public:
explicit test(QObject *parent = 0);
int value() const;
signals:
void valueChange ( int a);
public slots:
void setValue (int a);
private:
int *val;
};
#endif // TEST_H
and test.cpp :
#include "test.h"
test::test(QObject *parent) : QObject(parent)
{
}
int test::value() const
{
return val;
}
void test::setValue(int a)
{
val=a;
emit valueChange(val);
}
after that I dont know what am I do?
when run qmake just the qmake file create. when I build the project it shows me this error:
:-1: error: dependent '..\Test2ActiveXServer\qaxserver.rc' does not exist.
in that doc it says : "To build the ActiveX server executable run qmake to generate the makefile, and use your compiler's make tool as for any other Qt application. The make process will also register the controls in the system registry by calling the resulting executable with the -regserver command line option." . I don't understand it.
My question is :
Is that project is Active x server?
How to test it?
what am I do know?
How does it work?