Results 1 to 5 of 5

Thread: Qt + LoadLibrary + Windows

  1. #1
    Join Date
    Jan 2012
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt + LoadLibrary + Windows

    Hi,
    first, sorry for my english.

    I'm a developer that are doing a multiplatform app using C++ and Qt, but I have to use LoadLibrary to open a DLL, because the library and C files are not mine.

    My application has to work in Window 32 or 64 bit and Linux 32 or 64 bit (in Linux is working now)

    I'm using this sentence to load the library:
    HINSTANCE h = LoadLibrary("nsNEVLibrary.dll");
    the returned "h" is 268435456 that is not a valid library handle
    and GetLastError return 127

    nsNEVLibrary.dll is located in C:\Neuroshare\NeuroshareLibraries and this path is in my environment variable path
    I run "dependecy walker" to check if I have some missing libraries but no, I have all needed libraries in my C:\windows\system32

    Can anybody help me?
    Thank you in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt + LoadLibrary + Windows

    First of all use QLibrary.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2012
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt + LoadLibrary + Windows

    I used but no works:

    Qt Code:
    1. if (QLibrary::isLibrary("nsNEVLibrary.dll")) {
    2. QLibrary lib("nsNEVLibrary.dll");
    3. if (!lib.isLoaded()) {
    4. qDebug() << lib.errorString();
    5. }
    6. }
    To copy to clipboard, switch view to plain text mode 

    The returned string is: "Unknow error"

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt + LoadLibrary + Windows

    Maybe you should call load() first?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2012
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt + LoadLibrary + Windows

    ou
    sorry, I didn't try it.

    Thank you

Similar Threads

  1. Replies: 2
    Last Post: 6th September 2010, 14:22
  2. Replies: 3
    Last Post: 12th July 2010, 06:25
  3. Deployment Procedure On Windows On Linux and Windows
    By Harshith J.V. in forum Installation and Deployment
    Replies: 4
    Last Post: 9th July 2009, 11:27
  4. Windows focus / Windows Shutdown Problems
    By December in forum Qt Programming
    Replies: 6
    Last Post: 22nd October 2007, 14:10
  5. Replies: 10
    Last Post: 25th February 2007, 00:23

Tags for this Thread

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.