473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

HOW TO: Declare DLL functions at run time only

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

Nov 20 '05 #1
14 1568
Hi M.

When you do not know exactly know how to use a DLL function, why than not
first look to managed code which will do run your program a lot more save.

http://msdn.microsoft.com/library/de...l/win32map.asp

The tickcount is one of the most easy ones in dotNet
Dim MyTick As Integer = Environment.TickCount

Just my thought

Cor
Nov 20 '05 #2
Hi M.

When you do not know exactly know how to use a DLL function, why than not
first look to managed code which will do run your program a lot more save.

http://msdn.microsoft.com/library/de...l/win32map.asp

The tickcount is one of the most easy ones in dotNet
Dim MyTick As Integer = Environment.TickCount

Just my thought

Cor
Nov 20 '05 #3
Please don't answer a question that you don't understand, OK?

Cor Ligthert wrote:
Hi M.

When you do not know exactly know how to use a DLL function, why than not
first look to managed code which will do run your program a lot more save.

http://msdn.microsoft.com/library/de...l/win32map.asp

The tickcount is one of the most easy ones in dotNet
Dim MyTick As Integer = Environment.TickCount

Just my thought

Cor


Nov 20 '05 #4
Please don't answer a question that you don't understand, OK?

Cor Ligthert wrote:
Hi M.

When you do not know exactly know how to use a DLL function, why than not
first look to managed code which will do run your program a lot more save.

http://msdn.microsoft.com/library/de...l/win32map.asp

The tickcount is one of the most easy ones in dotNet
Dim MyTick As Integer = Environment.TickCount

Just my thought

Cor


Nov 20 '05 #5
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

"M. Angelo" <So***@No.One> a écrit dans le message de
news:Or**************@tk2msftngp13.phx.gbl...
Please don't answer a question that you don't understand, OK?

Cor Ligthert wrote:
Hi M.

When you do not know exactly know how to use a DLL function, why than not first look to managed code which will do run your program a lot more save.
http://msdn.microsoft.com/library/de...l/win32map.asp
The tickcount is one of the most easy ones in dotNet
Dim MyTick As Integer = Environment.TickCount

Just my thought

Cor

Nov 20 '05 #6
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

"M. Angelo" <So***@No.One> a écrit dans le message de
news:Or**************@tk2msftngp13.phx.gbl...
Please don't answer a question that you don't understand, OK?

Cor Ligthert wrote:
Hi M.

When you do not know exactly know how to use a DLL function, why than not first look to managed code which will do run your program a lot more save.
http://msdn.microsoft.com/library/de...l/win32map.asp
The tickcount is one of the most easy ones in dotNet
Dim MyTick As Integer = Environment.TickCount

Just my thought

Cor

Nov 20 '05 #7
"M. Angelo" <So***@No.One> schrieb
Please don't answer a question that you don't understand, OK?

Please write a question that can be understood.
I'd given the same answer.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8
"M. Angelo" <So***@No.One> schrieb
Please don't answer a question that you don't understand, OK?

Please write a question that can be understood.
I'd given the same answer.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #9
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
Nov 20 '05 #10
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
Nov 20 '05 #11
* "M. Angelo" <So***@No.One> scripsit:
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


<URL:http://www.msjogren.net/dotnet/eng/samples/dotnet_dynpinvoke.asp>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #12
* "M. Angelo" <So***@No.One> scripsit:
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


<URL:http://www.msjogren.net/dotnet/eng/samples/dotnet_dynpinvoke.asp>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #13
* "M. Angelo" <So***@No.One> scripsit:
Please don't answer a question that you don't understand, OK?


Please do not post the same question twice.

:-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #14
* "M. Angelo" <So***@No.One> scripsit:
Please don't answer a question that you don't understand, OK?


Please do not post the same question twice.

:-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
6
by: David T. Ashley | last post by:
Hi, In my project, I typically declare and define variables in the .H file, i.e. DECMOD_MAIN UINT8 can_message_201_status_global #ifdef MODULE_MAIN = HAS_NEVER_BEEN_RECEIVED #endif ;
8
by: Johm | last post by:
In my codes i am often referring to one and the same controls.Is it possible to declare these controls only once and then insert them in all my functions and subs? For example, i am often...
6
by: Jason Shohet | last post by:
2 questions for anyone who can answer: 1. in class declarations, I realize you have to use the NEW keyword if you want to declare & instantiate some class at the same time. Whats an advantage...
2
by: Derrick | last post by:
How does one declare an event within an interface, so that every class which implements that interface must implement that event? I think I just need to specifiy the actual event as I would a...
12
by: M. Angelo | last post by:
If you don't know or are in doubt, please read the answers instead of showing your ignorance. This is not a newbie question. Anyone know how to do something like this: Private Delegate...
14
by: M. Angelo | last post by:
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:...
1
by: marfi95 | last post by:
I'm trying to call methods in a C++ dll from vb.net that is not a .com component. I've read I can just use regular Declare statements just as you do in VB6 except that some of the types need to...
2
by: mike | last post by:
I have some SQL code I wrote that returns about 15,000 rows (using a group by statement, raw data is around 1mill rows). In this code I have a few variables that I declare and set. These variables...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.