Skip to content

DYLIBLOAD ​


Loads to a Dynamic Link Library (DLL) into memory at runtime

Syntax ​

` declare function Dylibload ( byref libname as string ) as any Pointer

`

Usage ​

` result = Dylibload ( libname )

`

Parameters ​

libname

A string containing the name of the library to load.

Return Value ​

The pointer handle of the library loaded. Zero on error

Description ​

Dylibload is used to link at runtime libraries to your program. This function does the link and returns a handle that must be used with Dylibsymbol when calling a function in the library and with Dylibfree when releasing the library.

Note: If the libname string (without extension) already includes a character dot (.), it may be mandatory to explicitly specify the filename extension to avoid any parser ambiguity.

Examples ​

See the dynamic loading example on the Shared Libraries page.

Platform Differences ​

  • DOS: dynamic link libraries have ".dxe" file name extension and the full libname must be specified: "<name>.dxe".
  • DOS: calling dylibload( ``"``"`` ), using an empty file name will initialize the run time library exports.
  • DOS: see specific Shared Libraries - DOS page

Dialect Differences ​

  • Not available in the -lang qb dialect unless referenced with the alias __Dylibload.

Differences from QB ​

  • New to FreeBASIC

See also ​

  • Dylibsymbol
  • Dylibfree
  • Export

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft