Recent

Author Topic: [CLOSED] LoadLibrary() in initialization section  (Read 1163 times)

julkas

  • Guest
[CLOSED] LoadLibrary() in initialization section
« on: July 04, 2020, 06:10:21 pm »
Is it safe call LoadLibrary() from unit initialization section?
Thanks.
« Last Edit: July 05, 2020, 06:55:59 pm by julkas »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: LoadLibrary() in initialization section
« Reply #1 on: July 04, 2020, 10:16:07 pm »
Yes, in fact its most likely the best place since that gets called before any of the code does in the units.

Those sections get called first before the first line of your main file gets executed.
The only true wisdom is knowing you know nothing

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: LoadLibrary() in initialization section
« Reply #2 on: July 05, 2020, 11:00:36 am »
It is if your application is an executable, not dynamic loadable library. Windows OS  will add some restrictions on this : https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices

Under Unix OS (at least Linux), it seems that you can use it as you fit without any restrictions.

julkas

  • Guest
Re: LoadLibrary() in initialization section
« Reply #3 on: July 05, 2020, 06:55:00 pm »
Thanks.

 

TinyPortal © 2005-2018