HOW TO: Declare DLL functions at run time only

  • Thread starter Thread starter M. Angelo
  • Start date Start date
M

M. Angelo

Anyone know how to do something like this:

Private Delegate Function Tick() As Integer
Private Sub MySub()
Dim MyExternalFunc As Tick
'???????? what to write here to declare the equivalent of:
'MyExternalFunc = AddressOf Function GetTickCount Lib "kernel32"
Alias "GetTickCount" () As Integer
Me.Text = MyExternalFunc()
End Sub
 
Personnaly, I understand exactely what you would like to do but ... Is it
really necessary ? First you need the same signature of GetTickCount and
your Delegate Tick no ? And second why would you not like to declare the API
function before ? You could declare all functions and in a switch case you
could select which one you want to use ... It is not useful to declare on
the fly. It's my opinion.

Bismark
 
Hi Bismark,

I am in doubt, where does declare a delegate function is different from
declaring an Api function?

It declares in my opinon different types (or whatever you name it).

Cor
 
Back
Top