Results 1 to 7 of 7

Thread: Delphi dll function import under QT

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Delphi dll function import under QT

    Return true but when i call the imported function (GetAdminSID) the application terminated this message: "exited with code -1073741819"

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

    Default Re: Delphi dll function import under QT

    Search our forums and/or msdn for C0000005. If I were to guess, I'd say you were passing an invalid parameter to the function or expecting an invalid return type. Or possibly the function requires some environment that is missing outside a Delphi program.
    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. The following user says thank you to wysota for this useful post:

    Gep (19th April 2011)

  4. #3
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Delphi dll function import under QT

    Function parameter is the problem:

    Qt Code:
    1. function GetAdminSID: String;
    To copy to clipboard, switch view to plain text mode 

    becouse I changed:

    Qt Code:
    1. function GetAdminSID: PChar;
    To copy to clipboard, switch view to plain text mode 

    Everything works fine.

    but unfortunately, this DLL is already in use. So I would not change. This version should I use:

    Qt Code:
    1. function GetAdminSID: String;
    To copy to clipboard, switch view to plain text mode 

    Is idea someones of the declaration I how to change?

    Qt Code:
    1. extern "C" { typedef char*(__stdcall * PGetAdminSID)(); }
    To copy to clipboard, switch view to plain text mode 

    Thanks!
    Hi!

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

    Default Re: Delphi dll function import under QT

    You need to check what is the C representation for Delphi's String class. You can always work around the problem by using another dll that will contain a delphi function returning a PChar that will call your original function to serve as an adapter.
    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.


  6. The following user says thank you to wysota for this useful post:

    Gep (19th April 2011)

  7. #5
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Delphi dll function import under QT

    Yes, if other is not so feasible. Although not very elegant solution. Still I look around

    Thanks for everything!
    Hi!

Similar Threads

  1. Convert Delphi Forms into QT4 ui's
    By jhering in forum Qt Tools
    Replies: 0
    Last Post: 12th September 2010, 09:43
  2. Replies: 4
    Last Post: 14th October 2009, 04:28
  3. Qt vs Delphi TApplicationEvents
    By BingoMaster in forum Newbie
    Replies: 1
    Last Post: 26th September 2009, 23:03
  4. Delphi and Qt4
    By dellegi in forum Qt Programming
    Replies: 0
    Last Post: 22nd April 2009, 16:28
  5. Qt us Builder and Delphi
    By zlatko in forum General Discussion
    Replies: 3
    Last Post: 8th May 2006, 09:08

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.