Is there any way that a I can load a given DLL and declare a function at run time? The user would select a DLL, then type in the name of a function to call within that DLL.

For example, could something like this be declared at runtime:

NewDll = "advapi32.dll"
NewFunction = "RegCreateKey"

Declare Function NewFunction Lib NewDll (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long

1) Is it possible?
2) If so, are there any samples to get me started?

Thanks,
AC