Skip to content

GetProcAddress alternative declaration #38

@GCuser99

Description

@GCuser99

Hi Jon,

How do we handle this Win API declaration that has an argument that can take either a string or a numeric value? The docs say:

"[in] lpProcName: The function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero."

I'm assuming tB does not yet handle overloading of Win API calls...

'Existing WinDevLib
Private Declare PtrSafe Function GetProcAddress Lib "kernel32" (ByVal hModule As LongPtr, ByVal lpProcName As String) As LongPtr

'An alternative to handle overload of second argument??
Private Declare PtrSafe Function GetProcAddressOrdinal Lib "kernel32" Alias "GetProcAddress" (ByVal hModule As LongPtr, ByVal lpProcOrdinal As Long) As LongPtr

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions