Return true but when i call the imported function (GetAdminSID) the application terminated this message: "exited with code -1073741819"
Return true but when i call the imported function (GetAdminSID) the application terminated this message: "exited with code -1073741819"
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.
Gep (19th April 2011)
Function parameter is the problem:
Qt Code:
function GetAdminSID: String;To copy to clipboard, switch view to plain text mode
becouse I changed:
Qt Code:
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:
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:
extern "C" { typedef char*(__stdcall * PGetAdminSID)(); }To copy to clipboard, switch view to plain text mode
Thanks!
Hi!
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.
Gep (19th April 2011)
Yes, if other is not so feasible. Although not very elegant solution. Still I look around
Thanks for everything!
Hi!
Bookmarks