Results 1 to 16 of 16

Thread: ActiveX | from MFC to Qt5

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2015
    Location
    Saint-Petersburg, Russia
    Posts
    10
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Question ActiveX | from MFC to Qt5

    I bought Fingerprint reader ZK7500, it SDK is written in MFC. I want to remake it to Qt.

    1) to code
    Qt Code:
    1. QAxWidget *ax = new QAxWidget();
    2. ax->setControl(QString::fromUtf8("{CA69969C-2F27-41D3-954D-A48B941C3BA7}"));
    To copy to clipboard, switch view to plain text mode 
    I received a warning
    Qt Code:
    1. QAxBase: Unhandled type LPSTR
    To copy to clipboard, switch view to plain text mode 

    This is critical?

    2) at MFC inbound events handled as follows:
    Qt Code:
    1. BEGIN_EVENTSINK_MAP(CDemoDlg, CDialog)
    2. //{{AFX_EVENTSINK_MAP(CDemoDlg)
    3. ON_EVENT(CDemoDlg, IDC_ZKFPENGX2, 8 /* OnImageReceived */, OnOnImageReceivedZkfpengx2, VTS_PBOOL)
    4. ON_EVENT(CDemoDlg, IDC_ZKFPENGX2, 10 /* OnCapture */, OnOnCaptureZkfpengx2, VTS_BOOL VTS_VARIANT)
    5. ON_EVENT(CDemoDlg, IDC_ZKFPENGX2, 9 /* OneEnroll */, OnOnEnrollZkfpengx2, VTS_BOOL VTS_VARIANT)
    6. ON_EVENT(CDemoDlg, IDC_ZKFPENGX2, 5 /* OnFeatureInfo */, OnOnFeatureInfoZkfpengx2, VTS_I4)
    7. //}}AFX_EVENTSINK_MAP
    8. END_EVENTSINK_MAP()
    To copy to clipboard, switch view to plain text mode 

    How to do it on Qt? I have not found *.TLB file with definitions of functions.

    3) I have many functions generated by MFC Wizard such as:
    Qt Code:
    1. void SaveJPG(LPCTSTR FileName)
    2. {
    3. static BYTE parms[] = VTS_BSTR ;
    4. InvokeHelper(0x18, DISPATCH_METHOD, VT_EMPTY, NULL, parms, FileName);
    5. }
    6. long InitEngine()
    7. {
    8. long result;
    9. InvokeHelper(0x1a, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
    10. return result;
    11. }
    12. ...
    To copy to clipboard, switch view to plain text mode 

    I found this topic, but did not work out. How it correctly to remake to Qt.

    Sorry for my Google Translate.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: ActiveX | from MFC to Qt5

    Maybe check if the vendor has a real SDK, one that does not require any specific UI, at least not one abandoned years ago.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: ActiveX | from MFC to Qt5

    I have not found *.TLB file with definitions of functions.
    You can #import (using MSVC) the DLL file, and it will create the .tli and .tlh files with the interface information. See this.

    That might be enough to get you started wrapping the interface in Qt ActiveX methods calls.

Similar Threads

  1. Activex and qml
    By codeman in forum Qt Quick
    Replies: 4
    Last Post: 7th September 2015, 17:11
  2. ActiveX-javascript invoke activex interface exception
    By zhy282289 in forum Qt Programming
    Replies: 0
    Last Post: 29th October 2012, 02:58
  3. ActiveX in QT
    By Ali Reza in forum Newbie
    Replies: 1
    Last Post: 21st June 2012, 14:54
  4. how to use WMI and ACTIVEX in Qt
    By sarang_neo in forum Newbie
    Replies: 5
    Last Post: 13th April 2011, 10:34
  5. ActiveX
    By franco.amato in forum Qt Programming
    Replies: 6
    Last Post: 29th December 2009, 17:06

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.