Hi All:
I'm trying to use Run-Time Dynamic Linking. I defined a function type and a function variable. Then I load the library into memory, and set up the above function for run time loading, like the following:
//Function example: int count()
typedef int (*FUNC)()
...
HINSTANCE hinstLib;
hinstLib=LoadLibrary("mydll.dll"
FUNC func1;
if(hinstLib!=NULL)
{
func1=(func1type)GetProcAddress(hinstLib,"func1"
};
But if the function is an interface function, such as
STDMETHOD(Count)(/*[out]*/long *plCount)..., I used
typedef HRESULT (*FUNC)(Long); and got the error message that the specified procedure could not be found.
Does anyone have a clue to define this kind of function?
Thanks in advance.
Kay
I'm trying to use Run-Time Dynamic Linking. I defined a function type and a function variable. Then I load the library into memory, and set up the above function for run time loading, like the following:
//Function example: int count()
typedef int (*FUNC)()
...
HINSTANCE hinstLib;
hinstLib=LoadLibrary("mydll.dll"
FUNC func1;
if(hinstLib!=NULL)
{
func1=(func1type)GetProcAddress(hinstLib,"func1"
};
But if the function is an interface function, such as
STDMETHOD(Count)(/*[out]*/long *plCount)..., I used
typedef HRESULT (*FUNC)(Long); and got the error message that the specified procedure could not be found.
Does anyone have a clue to define this kind of function?
Thanks in advance.
Kay