Calling .Net unmanaged code from Delphi code
Delphi contains many types in its decelerations Type Record
Type Instance
Type 开发者_高级运维 Class
They ether contain a layout of a structure, or a group of methods or a Class that contains both. DotNet contains many of these objects as unmanaged code just as you declare Delphi decelerations but they are accessed through DLL’s. 1/ The question is do you use TComObjectfactroy to access a deceleration in external DLL’s? Or do you use something else. I have no material to even read on the subject.
2/ I know you can get the object pointer (Class pointer) with a create method as it’s cleared with FreeAndNil as a pointer. How can you use create into a DLL containing a object.
3/ I have .Net ilasm.exe and ildasm.exe and a Delphi asm decompiler that I wish to find the main DLL in P/Invoke and place P/Invoke code into Delphi code.
But I have to understand Delphi objects in this way. Has any one read or seen anything that comes near to this subject? Until now I have not got subject matter correct that people can begin to understand me.
Juliano 117 gave me http://msdn.microsoft.com/en-us/library/ms973872.aspx But thai is the Windows end!!!!!!! And not Delphi end.
For information about the Delphi object model and the memory layout of classes, I belive that this chapter in the book "Delphi in a Nutshell" can give you some good information:
http://oreilly.com/catalog/delphi/chapter/ch02.html
Rudy Velthuis has also written an excellent article about this topic:
http://rvelthuis.de/articles/articles-pointers.html
It is, however, not recommended to pass classes between a dll and exe.
If you intend to combine managed .NET code and unmanaged native Delphi code in the same project, then you should have a look at RemObjects Hydra. This is a framework for generating plugins that will make this work a lot easier.
精彩评论