首页  »   VB

vb.net实现Vb中的Any变体部类

网友分享于:2013-07-26  浏览:1次
vb.net实现Vb中的Any变体类型

今天无意中发现可以替代VB中的Any 在API声明中可以使用<MarshalAs(UnmanagedType.AsAny)>

VB中声明的API

1 Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)

在vb.net可以这样玩

1 Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, <MarshalAs(UnmanagedType.AsAny)> lParam As Object) As Int32

 

相关解决方案

最新解决方案