Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
[CLOSED] LoadLibrary() in initialization section
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Modern For Loop question
by
lucamar
[
Today
at 05:09:13 pm]
H2PasWizard wizard fail o...
by
BlueIcaro
[
Today
at 05:07:15 pm]
Setting a Timer and Serve...
by
Weitentaaal
[
Today
at 04:37:42 pm]
Problems on Windows 10
by
Peter H
[
Today
at 04:35:32 pm]
open source big projects
by
lainz
[
Today
at 04:34:59 pm]
[LAMW] Using App Bundles ...
by
rsu333
[
Today
at 04:34:07 pm]
Compiler Generated Tempor...
by
Coxy
[
Today
at 04:04:42 pm]
Cant Find Certain Dll
by
Weitentaaal
[
Today
at 03:51:58 pm]
Unit containing its own f...
by
lucamar
[
Today
at 03:48:32 pm]
[LAMW] Debug Apk From IDE
by
Leopreo
[
Today
at 02:47:49 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [CLOSED] LoadLibrary() in initialization section (Read 576 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
»
Logged
jamie
Hero Member
Posts: 4053
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.
Logged
The only true wisdom is knowing you know nothing
Cyrax
Hero Member
Posts: 839
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.
Logged
julkas
Guest
Re: LoadLibrary() in initialization section
«
Reply #3 on:
July 05, 2020, 06:55:00 pm »
Thanks.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[CLOSED] LoadLibrary() in initialization section
TinyPortal
© 2005-2018