Table of Contents

Method GetProcAddress

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetProcAddress(nint, string)

Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).

public static extern nint GetProcAddress(nint hModule, string procName)

Parameters

hModule nint

A handle to the DLL module that contains the function or variable. This handle must be obtained by calling LoadLibrary(string) or a similar method.

procName string

The name of the function or variable whose address is to be retrieved. Alternatively, this can be the ordinal value of the function, specified as a string.

Returns

nint

A pointer to the function or variable if the operation succeeds; otherwise, Zero.

Remarks

This method is used to dynamically retrieve the address of a function or variable exported by a DLL. Ensure that the module handle passed to hModule is valid and that the function or variable name specified in procName exists in the module.