Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function returns the address of the specified exported dynamic-link library (DLL) function.
FARPROC GetProcAddress( HMODULE hModule , LPCWSTR lpProcName );
Parameters
Return Values
The address of the DLL's exported function indicates success. NULL indicates failure. To get extended error information, call GetLastError.
Remarks
For Windows CE version 3.0 and later, the ASCII version of this function, GetProcAddressA, is supported. With this version, the lpProcNameparameter is of the type LPCSTR.
The GetProcAddressfunction is used to retrieve addresses of exported functions in DLLs.
The spelling and case of the function name pointed to by lpProcNamemust be identical to that in the EXPORTSstatement of the source DLL's module-definition (.DEF) file. The exported names of Win32 APIs may differ from the names you use when calling these functions in your code. This difference is hidden by macros used in the SDK header files.
The lpProcNameparameter can identify the DLL function by specifying an ordinal value associated with the function in the EXPORTSstatement. GetProcAddressverifies that the specified ordinal is in the range 1 through the highest ordinal value exported in the .DEF file. The function then uses the ordinal as an index to read the function's address from a function table. If the .DEF file does not number the functions consecutively from 1 to N(where Nis the number of exported functions), an error can occur where GetProcAddressreturns an invalid, non-NULL address, even though there is no function with the specified ordinal.
In cases where the function may not exist, the function should be specified by name rather than by ordinal value.
When using GetProcAddressto obtain the address of the InitSecurityInterfacefunction, use SECURITY_ENTRYPOINT for the lpProcNameparameter.
Requirements
Runs On | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winbase.h | Coredll.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
FreeLibrary, GetLastError, GetModuleHandle, LoadLibrary