Delphi unit initialization not always called

后端 未结 4 1175
花落未央
花落未央 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 19:48

    Not every unit in a BPL will necessarily be initialized, under certain circumstances. If I had to guess, I'd say that this BPL is linked to your program at load time and not dynamically loaded later? Try putting the name of the unit you're using into the program's uses list in the DPR. That should fix it.

提交回复
热议问题