Results 1 to 4 of 4

Thread: Using a Win32 library

  1. #1
    Join Date
    May 2010
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Using a Win32 library

    I am newbie in Qt4. Using mingW complier.

    I have an application that is coded in MFC which include <atlbase.h> and <atlsafe.h> head. I would like to rebuild the application in QT4 but unfortunately I can not include these head file successfully. The main usage is CComSafeArray<BSTR> and CComPtr<T>.

    I would like to know if it is possible to use them in QT4. If not, let me know. If yes (what I hope for) please provide a simple example or a reference to a site which shows how to do this. Or some replace method for CComSafeArray<BSTR> and CComPtr<T> in Qt?

    Many thanks in advance for your advice.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using a Win32 library

    Any static library compiled with MSVC cannot be linked against by gcc. If you are only using the templates from the header, you should be able to get them by telling gcc where to find those templates. You can do so by adding say "c:\program files\microsoft visual studio 9.0\Common\VC\include" to your include path. I cannot guarantee the path is correct, but it is along those lines you have to search.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,677
    Thanks
    13
    Thanked 1,596 Times in 1,524 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Using a Win32 library

    These are COM related. Is your application using COM? The obvious porting action would be to involve ActiveQt and let it worry about conversion of Windows COM types to Qt types.

  4. #4
    Join Date
    May 2010
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using a Win32 library

    Quote Originally Posted by ChrisW67 View Post
    These are COM related. Is your application using COM? The obvious porting action would be to involve ActiveQt and let it worry about conversion of Windows COM types to Qt types.
    Yes, I use COM in Qt. Because the COM that supplied by 3rd party is large and complicated and the given sample was written in MFC, in order to save time I want to transfer this sample to Qt environment, so I does not use ActiveQt method and cause the problem.

Similar Threads

  1. Replies: 4
    Last Post: 18th December 2009, 19:55
  2. Win32 static library
    By jacky in forum Newbie
    Replies: 1
    Last Post: 19th April 2009, 16:35
  3. win32 api
    By weixj2003ld in forum Newbie
    Replies: 1
    Last Post: 17th April 2009, 08:46
  4. Using a Win32 static library
    By jacky in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2009, 05:39
  5. Win32 qmake: building a static library
    By Amanda in forum Qt Programming
    Replies: 5
    Last Post: 8th November 2006, 20:32

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.