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
open source big projects
by
Handoko
[
Today
at 04:23:42 pm]
Using App Bundles instead...
by
pasquale
[
Today
at 04:11:30 pm]
Compiler Generated Tempor...
by
Coxy
[
Today
at 04:04:42 pm]
Cant Find Certain Dll
by
Weitentaaal
[
Today
at 03:51:58 pm]
Modern For Loop question
by
ASBzone
[
Today
at 03:51:13 pm]
Unit containing its own f...
by
lucamar
[
Today
at 03:48:32 pm]
Problems on Windows 10
by
lainz
[
Today
at 03:09:17 pm]
[LAMW] Debug Apk From IDE
by
Leopreo
[
Today
at 02:47:49 pm]
Does Any1 know a Tool to ...
by
JD
[
Today
at 01:09:19 pm]
[SOLVED] Is there any way...
by
DmytroLev
[
Today
at 01:05:33 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [CLOSED] LoadLibrary() in initialization section (Read 575 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