Click to See Complete Forum and Search --> : How to call a function by a pointer to that function?


hotcoffee
April 6th, 1999, 07:49 AM
In C++, I can call a function in dll like this:
hModule = LoadLibrary(szDllName);
pfnProc = (FARPROC*)GetProcAddress(hModule, szProcName)
pfnProc();


But in vb, can I call a function like above.(through a function pointer from a GetProcAddress call.)

April 6th, 1999, 08:47 AM
in VB you can use the AddressOf operator to retrieve the address of a VB sub or function. You cannot call that function as in C, but you can pass the address to an API function that takes a function address as a parameter. This is usually done in subclassing.