Results 1 to 2 of 2

Thread: QString to LPCWSTR

  1. #1
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default QString to LPCWSTR

    I'm using MS Developer Studio and want to see the debug output (fprintf gets lost within MS Dev Studio).

    I want to use OutputDebugString(), but it takes a LPCWSTR.

    How do I convert from a QString to a LPCWSTR?
    - brc

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QString to LPCWSTR

    Quote Originally Posted by bruccutler View Post
    I'm using MS Developer Studio and want to see the debug output (fprintf gets lost within MS Dev Studio).
    Then maybe you should try qDebug()?

    Quote Originally Posted by bruccutler View Post
    How do I convert from a QString to a LPCWSTR?
    Try QString::toWCharArray().

  3. The following user says thank you to jacek for this useful post:

    bruccutler (1st May 2007)

Similar Threads

  1. Problem in converting QString to QChar array?
    By KaKa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 01:38
  2. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 18:59
  3. QString problem
    By vermarajeev in forum Qt Programming
    Replies: 9
    Last Post: 26th October 2006, 20:10
  4. QSqlQueryModel + set Write
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2006, 09:55
  5. Converting QString to unsigned char
    By salston in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 23:10

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.