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
 
* "M. Angelo said:
Please don't answer a question that you don't understand, OK?

Please do not post the same question twice.

:-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top