IProcedureAddress

The IProcedureAddress template class is a wrapper for dynamic link library (DLL) entry points. The template argument is as follows:

PtrToFnType
Type of the entry point to load or call; this must be a pointer-to-function type.

This Open Class Library uses an operating system function to do a runtime link to the DLL, and it uses another operating system function to acquire the runtime address of a specified function in the DLL. When the link is established and the address is acquired, you can call code that was not accessible to the linker when the executable module was built.

This class provides for the following:

AIX Considerations

AIX does not support this class.


IProcedureAddress - Member Functions and Data by Group

Constructors & Destructor

You must provide the following two pieces of information to construct objects of this template class:

You can also destruct objects of this class.


[view class]
~IProcedureAddress
public:
~IProcedureAddress()

This destructor frees the IDynamicLinkLibrary object that this class creates during construction. If you need to use the dynamic link library after the IDynamicLinkLibrary object is freed, construct an object of this class using an explicitly created IDynamicLinkLibrary object instead of the dynamic link library name.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
IProcedureAddress


Overload 1
public:
IProcedureAddress( unsigned long ordinal, IDynamicLinkLibrary& aDLL )

ordinal
Unsigned long value that represents the entry point within the DLL.
aDLL
Reference to a dynamic link library object that wrappers the DLL.

Create an object to dynamically load an entry point using the specified entry point ordinal and a reference to an existing IDynamicLinkLibrary object. If you know the ordinal of the entry point and have already loaded the dynamic link library, use this constructor.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Overload 2
public:
IProcedureAddress( const char* entryPoint, IDynamicLinkLibrary& aDLL )

entryPoint
Pointer that identifies the name of the entry point within the DLL.
aDLL
Reference to a dynamic link library object that wrappers the DLL.

Create an object to dynamically load an entry point using the specified entry point name and a reference to an existing IDynamicLinkLibrary object. If you know the name of the entry point and have already loaded the DLL, use this constructor.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Overload 3
public:
IProcedureAddress( unsigned long ordinal, const char* dllName )

ordinal
Unsigned long value that represents the entry point within the DLL.
dllName
Pointer that identifies the DLL name.

Create an object to dynamically load an entry point using the specified entry point ordinal and DLL name. If you know the ordinal of the entry point and have not already loaded the DLL, use this constructor.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Overload 4
public:
IProcedureAddress( const char* entryPoint, const char* dllName )

entryPoint
Pointer that identifies the name of the entry point within the DLL.
dllName
Pointer that identifies the DLL name.

Create an object to dynamically load an entry point using the specified entry point name and DLL name. If you know the name of the entry point and have not already loaded the DLL, use this constructor.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Memory Model

These members help you determine if you are using a 32-bit or a 16-bit memory model.


[view class]
is32Bit
public:
bool is32Bit() const

Determines the memory model that the function runs in. If the entry point is 32-bit, this function returns true, and if the entry point is 16-bit, it returns false.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Pointers to Functions

These operators permit objects of this class to be used as regular function names.


[view class]
operator PtrToFnType
public:
operator PtrToFnType() const

Permits objects of this template class to be used in the same way as pointers to functions, which are like regular function names.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


IProcedureAddress - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data