Search Google

Thursday, November 29, 2007

function pointer type


typedef HINSTANCE (__stdcall *PFreeLibrary)( HINSTANCE );


以上是宣告function pointer type的範例,
PGetProcAddress是指到接受HMODULE, LPCSTR,產出FARPROC型態變數的變數指標

使用時
PGetProcAddress SomeFuncPtr;
SomeFuncPtr = AnotherFunc;

AnotherFunc的實做為
HINSTANCE AnotherFunc(HMODULE aa, LPCSTR bb) {...}

No comments: