Results 1 to 11 of 11

Thread: QPluginLoader instance always returns null

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QPluginLoader instance always returns null

    No, Both are in debug!
    do you have any other 3rd party dependencies which might be in release?

    I'd try to build your project in release and try to see if it works, its an easy test worth trying.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    May 2016
    Posts
    12
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QPluginLoader instance always returns null

    Quote Originally Posted by high_flyer View Post
    do you have any other 3rd party dependencies which might be in release?

    I'd try to build your project in release and try to see if it works, its an easy test worth trying.
    No man i dont

    I made simple console application and included my library header and lib file and called the function and this is the error i get when i run the application. So it must be it. But seriously why!!!

    The Code:

    Qt Code:
    1. LPWFSRESULT result = new WFSRESULT();
    2. WFSFreeResult(result)
    To copy to clipboard, switch view to plain text mode 

    mingw.jpg

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QPluginLoader instance always returns null

    Is this typo 'DeviceMAnager' really in the code or only in the code posted here?:
    Qt Code:
    1. if (plugin)
    2. {
    3. deviceManager = qobject_cast<DeviceMAnager *>(plugin);
    4. return true;
    5. }
    To copy to clipboard, switch view to plain text mode 

    I'd add some defencive code here:
    Qt Code:
    1. QPluginLoader * pluginLoader = new QPluginLoader(pluginPath.c_str());
    2. QObject * plugin = pluginLoader->instance();
    3.  
    4. if (plugin)
    5. {
    6. deviceManager = qobject_cast<DeviceMAnager *>(plugin);
    7. if(deviceManager) return true;
    8. return false;;
    9. }
    10. else
    11. {
    12. delete pluginLoader;
    13. return false;
    14. }
    To copy to clipboard, switch view to plain text mode 
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QPluginLoader instance always returns null

    Your screenshot clearly shows error 0xc0000135, which means STATUS_DLL_NOT_FOUND. This goes back to:
    Quote Originally Posted by me
    Are all of the external runtime dependencies of the plugin DLL met in the environment in which it is running? That is, if Device-Manager.dll depends on foolib.dll is that in the PATH?
    Is the MSXFS.DLL in the run time PATH of the process or in the same directory as the plugin DLL? Is everything the MSXFS.DLL depends on also in one of those locations?

  5. #5
    Join Date
    May 2016
    Posts
    12
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QPluginLoader instance always returns null

    Quote Originally Posted by ChrisW67 View Post
    Your screenshot clearly shows error 0xc0000135, which means STATUS_DLL_NOT_FOUND. This goes back to:

    Is the MSXFS.DLL in the run time PATH of the process or in the same directory as the plugin DLL? Is everything the MSXFS.DLL depends on also in one of those locations?
    Yes.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Well, I found the problem however its so silly. I run project over windows 10 32 bit and it work fine. Maybe something is not incompatible with 64 bit and that caused this mess.

    Thanks everyone for all your solution and i hope your solutions help others problem.

    Thanks alot!

Similar Threads

  1. QSslCertificate returns NULL in Windows Server 2008 R2
    By plopes21 in forum Qt Programming
    Replies: 3
    Last Post: 18th January 2013, 11:24
  2. QImage() returns Null Image
    By ustulation in forum Qt Programming
    Replies: 7
    Last Post: 24th July 2012, 13:52
  3. Replies: 33
    Last Post: 2nd December 2010, 16:47
  4. QDBusMessage returns NULL string
    By nrabara in forum Qt Programming
    Replies: 0
    Last Post: 27th November 2009, 06:09
  5. QPluginLoader instance
    By Jeff100 in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 06:47

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