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.)
Printable View
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.)
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.