Results 1 to 7 of 7

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

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

    Quote Originally Posted by arpspatel View Post
    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..
    Hi I'm trying your suggestion but I still don't understand how to get the pointer of the dll routines and call them.
    Why there is no a simple and clear example?

    as this:

    Qt Code:
    1. code for load com/.net dll
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. get routine pointers
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. call routine myroutine(param1, param2) with param 1 and 2
    To copy to clipboard, switch view to plain text mode 

    Is too difficult to provide a simple example?
    Franco Amato

  2. #2
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

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

    Hi,

    I have the same problem, looking for a simple example

    Vitor

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.