Results 1 to 5 of 5

Thread: The problem with QLibrary, help me!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Posts
    15
    Thanks
    2

    Default The problem with QLibrary, help me!

    I created a small application to use the library:

    Qt Code:
    1. // Test is a simple widget for testing
    2. Test::Test( QWidget* parent): QWidget(parent)
    3. {
    4. setupUi(this);
    5. QByteArray buffer;
    6. QLibrary mylib("kernel32);
    7. typedef int (*GetLocalInfo)( int Locale, int LcType, char* l, int chData);
    8.  
    9. GetLocaleInfor myFunc = (GetLocaleInfo)mylib.resolve("GetLocaleInfoA");
    10.  
    11. if(myFunc(0x400, 0x1003, Buffer.data(), 99) !=0)
    12. {
    13. int v1= 1;
    14. float b2= 2.0;
    15. QString str = "Hi everyone";
    16. QMessageBox::information(0, "Hello","Hello");
    17.  
    18. //...
    19. }
    To copy to clipboard, switch view to plain text mode 

    After the line "QString str = "Hi everyone";", the pointer "this" would be changed the address, I don't know why? If I replace QString by another Object( QTextEdit, QLineEdit...),
    it also changed "this" pointer. After the application changed the address, it display a warnining means that .exe was modified... and stop.

    Could you tell me that way not to change the address?
    Thanks!
    Last edited by jpn; 18th January 2008 at 21:03. Reason: missing [code] tags

Similar Threads

  1. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  2. [QMYSQL] connection problem
    By chaos_theory in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd July 2007, 09:52
  3. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.