Previously, the difference between BPL and DLL has always been a state in which some books (I have seen), even if it is more classic Delphi book, it is very vague! I finally found more detailed explanation !!!
................ ..
> But I Still Found Some Different, Such As That i CAN CREATE A
> Object from the host exe and this pass to a bpl and modify it safely, but
> IF i do same to a dll, i can not modify any reference property of the object.
>> but I still found some differences, such as I can create a object under the Host exe, >> it could be transfer to BPL and modified safely, but I can not do the same thing with dll >> cause the referenced properties can NOT Be Modified Correctly Under IT.
WHEN You Use packages, There IS Online, One Copy of Forms, One Copy of Sysutils, One Copy of System (Well, MOST OF IT), One Copy of stdctrls, etc.all class-corrected operations, such as the "is" and "as" operators, rely on class references. class references are actually just addresses. They point to definitions for the layouts of the classes' internals. (They point to what's called the virtual-method table ., the VMT) Two classes are the same if they point to the same VMT - if the addresses are equal.When you have a class defined in the EXE's copy of StdCtrls and the same class defined in a DLL's copy of StdCtrls, those classes will really have different addresses. The "is" and "as" operators will not work with cross-module clases. But when you use packages, there is only one copy of the class, kept in vcl70.bpl, so all modules That Reference That Package Will Share A Single Class Definition.another Factor Is The Memory Manager In System. All String Allocat ions ultimately call GetMem and FreeMem. If the EXE allocates a string, it uses its own GetMem. It then passes the string to a DLL, and the DLL might try to free it. The DLL will call its own copy of FreeMem, which won 't have access to the EXE's memory-manager structures, and you'll get errors. With packages, everything will use the same memory manager from rtl70.bpl. (This can also be solved by using a shared memory manager between the EXE and The dll; ShareMem is One Example. That Won '