Quais são as diferenças entre um especialista em Delfi BPL e um especialista em DLL Delphi

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

Pergunta

Eu estou trabalhando em um especialista em Delphi IDE, agora para evitar problemas de dependências, eu estava pensando em reconstruir este especialista como um especialista em DLL como foi sugerido em um desses respostas , agora meu especialista (compilado como bpl) Acesse o Screen e Application variáveis globais (instâncias do Delphi IDE), então eu estavaperguntando se eu compilar meu especialista como uma dll eu ainda posso acessar essas variáveis e também quero saber which are the main differences between a bpl delphi expert and a dll delphi expert?

Foi útil?

Solução

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

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top