Results 1 to 7 of 7

Thread: use a COM ( or a .Net ) object in a c++ QT application

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Apr 2008
    Posts
    35
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use a COM ( or a .Net ) object in a c++ QT application

    for loading dll u can use this.. its used in .NET activeQt example

    #using <dllname.dll>

    http://doc.qt.nokia.com/4.6/activeqt-dotnet.html

    here is sample code from the example

    Qt Code:
    1. #include <QString>
    2.  
    3. #using <mscorlib.dll>
    4. #include <vcclr.h>
    5.  
    6. using namespace System;
    7.  
    8. String *QStringToString(const QString &qstring)
    9. {
    10. return new String((const wchar_t *)qstring.utf16());
    11. }
    12.  
    13. QString StringToQString(String *string)
    14. {
    15. const wchar_t __pin *chars = PtrToStringChars(string);
    16. return QString::fromWCharArray(chars);
    17. }
    To copy to clipboard, switch view to plain text mode 

    use can also use QLibrary for loading dlls, not sure if it will work for .NET or COM.. give it a try..
    Last edited by arpspatel; 9th April 2010 at 03:37.

Similar Threads

  1. Getting std::string object from QString object ( qt3)
    By joseph in forum Qt Programming
    Replies: 11
    Last Post: 28th March 2013, 20:09
  2. writing object to the file(Object Persistance)
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 14:28
  3. How to know the object names of any generic application ?
    By soumyadeep_pan in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2009, 07:11
  4. Open a QMainWindow Object in QDialog Object
    By chuengchuenghq in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2008, 06:33
  5. Application very heavy for lots object
    By Kapil in forum Newbie
    Replies: 1
    Last Post: 29th April 2006, 17:33

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
  •  
Qt is a trademark of The Qt Company.