Are the methods from the Delphi library compatible with P / Invoke? And if not, is there any way to make them compatible?
There is access to the source code .dll.
Are the methods from the Delphi library compatible with P / Invoke? And if not, is there any way to make them compatible?
There is access to the source code .dll.
For a start, it is worth looking in the source code with which agreement on calls the functions from the library are exported.
If there is stdcall or cdecl , then such a function can be called without problems through P / Invoke. If the agreement is not specified there, then it will not be so easy.
In this case, if the source code of the library cannot be changed - the simplest solution would be a layer from another Delphi library:
procedure Foo(...); external 'MyLib.dll'; // ... procedure Foo_Std(...); stdcall; begin Foo(...); end; // ... exports Foo_Std name 'Foo'; stdcall keyword, then the calling agreement suddenly becomes standard :) - Pavel MayorovSource: https://ru.stackoverflow.com/questions/494011/
All Articles