Delphi unit initialization not always called

后端 未结 4 1178
花落未央
花落未央 2020-12-17 19:45

I have a unit within a .bpl, and I need a stringlist for a new function that I wrote. I want to the stringlist to persist for the lifetime of the app, so that each call can

4条回答
  •  长情又很酷
    2020-12-17 20:04

    How are you loading the bpl? Are you leaving it to Delphi to do the loading or are you manually loading the bpl? If you are manually loading the bpl, are you loading it as a "straight" dll or are you using LoadPackage to load it as a delphi package? I would think that either letting the vcl load it (through the requires processing) or using LoadPackage is required for the initialization sections to be run by the vcl...

提交回复
热议问题