仅在运行时声明DLL函数 [英] Declare DLL functions at run time only

查看:61
本文介绍了仅在运行时声明DLL函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你不知道或有疑问,请阅读答案而不是

显示你的无知。


这不是新手问题。


任何人都知道如何做这样的事情:


私人代表功能勾选()作为整数

Private Sub MySub()

Dim MyExternalFunc As Tick

''????????在这里写什么来声明相当于:

''MyExternalFunc = AddressOf函数GetTickCount Lib" kernel32"

Alias" GetTickCount" ()作为整数

Me.Text = MyExternalFunc()

结束子

解决方案

" M。安吉洛" <所以*** @ No.One> schrieb

如果您不知道或有疑问,请阅读答案,而不是显示您的无知。

这不是一个新手问题。

任何人都知道如何做这样的事情:

私人代表功能勾选()作为整数
私人子MySub()
Dim MyExternalFunc As Tick
''????????在这里写什么来声明相当于:
''MyExternalFunc = AddressOf函数GetTickCount Lib" kernel32"


说明:相当于!


别名GetTickCount ()作为整数
Me.Text = MyExternalFunc()
End Sub




VB.NET支持调用托管函数(包括导入的COMponents)

和标准 Declare语句或Dllimport

属性声明的函数。这就是全部。

-

Armin


如何报价以及原因:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


" M.安吉洛" <所以*** @ No.One> schrieb

如果您不知道或有疑问,请阅读答案,而不是显示您的无知。

这不是一个新手问题。

任何人都知道如何做这样的事情:

私人代表功能勾选()作为整数
私人子MySub()
Dim MyExternalFunc As Tick
''????????在这里写什么来声明相当于:
''MyExternalFunc = AddressOf函数GetTickCount Lib" kernel32"


说明:相当于!


别名GetTickCount ()作为整数
Me.Text = MyExternalFunc()
End Sub




VB.NET支持调用托管函数(包括导入的COMponents)

和标准 Declare语句或Dllimport

属性声明的函数。这就是全部。

-

Armin


如何报价以及原因:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


" Armin Zingler" < AZ ******* @ freenet.de> schrieb

VB.NET支持调用托管函数(包括导入的COMponents)和标准函数。由Declare
语句或Dllimport属性声明的函数。这就是全部。




忘了说:Loadlibrary(Ex),GetProcaddress;将它们用于谷歌团体

搜索。有一些结果。不知道

结果中是否有解决方案。

....

这里是/ one /:
http://www.codeproject.com/csharp/dyninvok.asp


-

Armin


如何报价及原因:
< a rel =nofollowhref =http://www.plig.net/nnq/nquote.htmltarget =_ blank> http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote。 HTML


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 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

解决方案

"M. Angelo" <So***@No.One> schrieb

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 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"
Explain: "equivalent of"!

Alias "GetTickCount" () As Integer
Me.Text = MyExternalFunc()
End Sub



VB.NET supports calling managed functions (including imported COMponents)
and "standard" functions declared by the Declare statement or the Dllimport
attribute. That''s all.
--
Armin

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


"M. Angelo" <So***@No.One> schrieb

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 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"
Explain: "equivalent of"!

Alias "GetTickCount" () As Integer
Me.Text = MyExternalFunc()
End Sub



VB.NET supports calling managed functions (including imported COMponents)
and "standard" functions declared by the Declare statement or the Dllimport
attribute. That''s all.
--
Armin

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


"Armin Zingler" <az*******@freenet.de> schrieb

VB.NET supports calling managed functions (including imported
COMponents) and "standard" functions declared by the Declare
statement or the Dllimport attribute. That''s all.



Forgot to say: Loadlibrary(Ex), GetProcaddress; use them for a google groups
search. There are some results. Don''t know if there''s a solution among the
results.
....
here is /one/:
http://www.codeproject.com/csharp/dyninvok.asp

--
Armin

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


这篇关于仅在运行时声明DLL函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆