The dll written by myself can be called successfully, but when the dll that needs to be used is called, an error is reported."DLL that needs to be used" as in 3th party DLL ?
Is my parameter type not written correctly, or whatHow are we suppose to tell if we do not know /what/ library you are using that caused that error and in what programming language the DLL was programmed in/for, what function you called and what the original parameter declaration is, what parameter declaration you have used and what parameters you have passed ?
I don't know what language the specific three-party library is. I got this result based on an incomplete document and decompilation。What is the name of the library and/or where can I obtain more information about the library ? (yes, I know you wrote the exact filename "MTAWdll.dll" but what does the abbreviation MTAW mean or what did the author named the DLL ?)
What is the name of the library and/or where can I obtain more information about the library ? (yes, I know you wrote the exact filename "MTAWdll.dll" but what does the abbreviation MTAW mean or what did the author named the DLL ?)
If it is a 3th party library that is distributed then there usually is an accompanied header file so that you know what functions (and their declaration) are present in the library and how the parameters are suppose to be used.
If you are truly decompiling a library that is not intended to be shared (closed/undocumented library) then you are basically on your own. There are some tools available that are able to obtain some valuable information about executables and DLL's but unfortunately my Windows days are long gone (e.g. I have no idea what tools to use these days).
You could always patch the library (overtake the original functions, show the passed parameters and call the original function) in order to obtain more information or run things through a debugger (olly comes to mind if that still exists)
If you are truly decompiling a library that is not intended to be shared (closed/undocumented library) then you are basically on your own. There are some tools available that are able to obtain some valuable information about executables and DLL's but unfortunately my Windows days are long gone (e.g. I have no idea what tools to use these days).
You could always patch the library (overtake the original functions, show the passed parameters and call the original function) in order to obtain more information or run things through a debugger (olly comes to mind if that still exists)
This is a library provided to us by a third party, and the documentation is also an incomplete document, because the docking personnel have left, so there are only these remnants, and this is the first time I have come into contact with it, so many things do not know how to do it. is correctThat begs the question: how do you know that the parameters and types used in your declaration ...:
That begs the question: how do you know that the parameters and types used in your declaration ...:.. are correct ?
function MTAW(filename: string; AmplitudeTh, BarrierValueForAutoLoc, coff_TimediffBetweensta, Va, xp, xk, yp, yk, zp, zk: single; SensorForLocation: Tpindex): TMTAWSOLUTION; stdcall; external 'F:\wz_work\DelphiWork\hello word\MTAWDll.dll';
Are you just winging/jolo it ?
If it is a library written in C then for one thing it is not using type string, rather pchar and/or pwidechar. pascal type Single is also not the same type single as used in c.
That looks like c++ to me...
Mtawdll::MTAW(System::UnicodeString,float,float,float,float,float,float,float,float,float,float,System::DynamicArray<int>)
The entire method name corresponds to the document, so it should be a delphi program.I was just going to suggest/ask if it was made with Delphi Rad Studio or something similar :)
If you know for sure the library was made with Delphi Rad Studio then you can probably use their online documentation to determine the exact type for the parameter types (and then find/locate the FreePascal/Lazarus equivalent).
I'm thinking about how to find the corresponding informationI edited my previous post to include an example for unicodestring.
I edited my previous post to include an example for unicodestring.
Here it is for System::DynamicArray (https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.DynamicArray)
It is tedious but do-able. Although i have no idea if you are able to accomplish this with freepascal/lazarus. The documentation is rather explicit about some of these types being Delphi (class) compatible. FPC/Lazarus <> Delphi on binary/VMT level.
Thank you very much,You're welcome.
I have already got the source code from a third party, and I don't need to guess the data type anymore.That makes things /a lot/ easier.
How can I debug the method of entering the dll source code, similar to the function of java entering the source code, I want to see the direction of the specific data and code, so as to know the cause of the error.That depends on what kind of source-code you now actually got.
This is my first time using delphi. Possible problems than Xiaobai, I hope you can provide your guidance.Delphi is really not my area of expertise (anymore). The last Delphi that I used was version 7.
That depends on what kind of source-code you now actually got.
Do you now have the complete source-code of the library (thus also including the implementation of the library functions itself, in which case you can actually see what happens with the parameters) or only the library header sources ?
I am guesstimating that it is the latter.