Results 1 to 7 of 7

Thread: 64 bit COM component

  1. #1
    Join Date
    Jun 2011
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 64 bit COM component

    Hi everyone.I had to make a dll from my current source to use in C#.I did it with QAxfactory and Qt 4.8.6 and made a dll and used in C# but when I set target build to 64 bit in vs studio my C# program cannot start because my dll(that I have built from my qt source) was 32 bit.I compiled my qt program 64 bit and made 64 bit dll but when I want to add it as COM component(I register it with Regsvr32.exe) it gives me this error :Self registration for d:\.......dll faild.I compiled it with qt 5.2.1 and the result was the same.What should I do???
    Qt Code:
    1. #ifndef OBJECTS_H
    2. #define OBJECTS_H
    3.  
    4. #include <QWidget>
    5. #include <QColor>
    6. QT_BEGIN_NAMESPACE
    7. QT_END_NAMESPACE
    8. class QSubWidget;
    9. class CirclesGraphicsScene;
    10. class CirclesGraphicsView;
    11. //! [0]
    12. class Circles : public QWidget
    13. {
    14. Q_OBJECT
    15. Q_CLASSINFO("ClassID", "{d574a747-8016-46db-a07c-b2b4854ee75c}")
    16. Q_CLASSINFO("InterfaceID", "{4a30719d-d9c2-4659-9d16-67378209f822}")
    17. Q_CLASSINFO("EventsID", "{4a30719d-d9c2-4659-9d16-67378209f823}")
    18. Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
    19. Q_PROPERTY(int circleNumber READ circleNumber WRITE setCircleNumber)
    20.  
    21. void createScene();
    22. public:
    23. Circles(QWidget *parent = 0);
    24.  
    25. QSize sizeHint() const;
    26. QColor backgroundColor()const;
    27. int circleNumber()const{return _n;}
    28.  
    29. public slots:
    30.  
    31. //--general
    32. void setBackgroundColor(QColor color);
    33. void setCircleNumber(int n);
    34.  
    35. //--axes
    36. void setAxesPen(QColor color, int w , int penStyle);
    37.  
    38. //--circles
    39. void addCircles(int r, int n, int s, int e);
    40.  
    41. ........//the rest
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: 64 bit COM component

    When you register the COM DLL, are the 64-bit Qt DLLs used by the COM server in the PATH where regsvr32 can find them?

    Also, I do not know if Qt COM DLLs need the qwindows.dll in the platforms subdirectory under the location of the COM DLL. Qt executables need this.
    Last edited by d_stranz; 14th November 2014 at 01:41.

  3. #3
    Join Date
    Jun 2011
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: 64 bit COM component

    Thank you for your replying.I put QtCore4.dll ,QtGui4.dll and my dll(that has been created from source) together in the same directory then I register it with regsvr32 successfully but when I want to add it in visual studio as Com component(toolbox-->right click--->choose Item--->COMcomponent)it give me this error self registration for ......dll faild.
    Last edited by hamidarr; 14th November 2014 at 20:21.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: 64 bit COM component

    You need to have all the dependencies of the Qt libraries
    http://qt-project.org/doc/qt-5/windo...cation-package

  5. #5
    Join Date
    Jun 2011
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: 64 bit COM component

    But I don not have any problem when I make 32 bit dll.I do the same things for 64 bit but it gives me this error.

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

    Default Re: 64 bit COM component

    Is Visual Studio a 64-bit app or a 32-bit app? Many Windows apps have not been ported to 64-bit versions. Just because Visual Studio can generate 64-bit code does not mean that Visual Studio itself is a 64-bit app. If it is a 32-bit app, it probably can't load an in-process 64-bit COM DLL. I don't think you can do anything to fix that. Unlike the change from 16-bit to 32-bit, there is no "thunking" in Windows to allow a 32-bit app to use a 64-bit DLL.

    You could try building your COM component as an out-of-process server. Or move into the modern world and not use COM at all :-).

  7. #7
    Join Date
    Jun 2011
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: 64 bit COM component

    Thank you for replying.Could you tell me how can I build my Com component as an out-of-process server???

Similar Threads

  1. using component's id in another QML
    By amitpatel22 in forum Qt Quick
    Replies: 2
    Last Post: 22nd May 2013, 17:01
  2. TCP/IP Network Component?
    By qtYoda in forum General Programming
    Replies: 2
    Last Post: 16th November 2011, 06:36
  3. Qt trending component
    By pan in forum Qt Programming
    Replies: 3
    Last Post: 11th February 2011, 09:18
  4. Is there a QIpAddrLineEdit component ?
    By lovelypp in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2008, 15:10
  5. Is there an Led component for qt ?
    By lovelypp in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2008, 18:36

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.