Которые являются различиями между экспертом BPL Delphi и экспертом DLL Delphi

StackOverflow https://stackoverflow.com/questions/6062588

Вопрос

Я работаю в эксперте Delphi IDE, теперь, чтобы избежать проблем зависимостей, я думал о восстановлении этого эксперта в качестве эксперта DLL, как было предложено в одном из этих Ответы , теперь мой эксперт (скомпилирован как BPL) доступа к Screen и Application Global переменные (экземпляры Delphi IDE), поэтому я былУдивительно, если я составляю свой эксперт как DLL, я все еще могу принять эти переменные, а также я хочу знать which are the main differences between a bpl delphi expert and a dll delphi expert?

Это было полезно?

Решение

Should I compile my wizard as a DLL or a Package? Packages are easier to load and unload without restarting the IDE (and hence easier to debug), but they can create unit naming conflicts in the IDE. Conflicts happen when the name a wizard's unit matches the name of a unit in another loaded design-time package. In this case, both packages can not be loaded at the same time. The recommended workaround is to prefix all of your unit names with a "unique" prefix. GExperts, for example, uses "GX_" as the name prefix for its units.

From this very good source about OTA: GExperts

Другие советы

When you access a global variable those would be global variables that are global to your DLL, not global to the main BDS.exe. I am not sure but I think your DLL would have its own Screen and Application global variable, if you linked in Forms, and the core of the VCL.

Those things which belong to the IDE itself are accessed through the Open Tools Api (OTA). I believe that you do not normally share any objects between the IDE your expert anyways, and if you were to try to do so, it would be problematic. Anything at all that you do that bypasses the OTA is going to be vulnerable to breaking in strange ways, especially in future versions of the IDE.

Dependency problems are of course a big reason to not use BPL based packages, but I think an even bigger reason is to maintain a complete separation between your tool's internals, and the internals of the IDE.

Remember that a DLL target, like an executable target, is statically linked. That is the core of the difference. If your expert provides functionality that uses the legal public documented OTA interfaces only, then moving to a DLL should be problem free. If you use some back door hacks that are possible with BPLs, then I can't advise you further.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top