作成: 2005-12-21 21:31:30 (水)
更新: 2006-02-05 02:55:50 (日)
参照: 6965

#contents



Visual Studio 2005 Express Edition

VS 2005のExpress Editionは事実上,無償提供へ

Microsoft Visual Web Developer 2005 Express Edition

SQLサーバ ユーザ認証のサンプルコードをビルドしてみた。

VS2005_VWebDev2005Exp.png



以下は旧情報です。

Web開発用 Visual Web Dev 2005 Expressの感想

  • <%@ Page Language="C#" CompileWith="Logon.aspx.cs" ClassName="Logon_aspx" %>



VS2005 Express BETA2でコールバック関数をデリゲート経由で

  • Visual Basic Reference: Error Messages Add a delegate for AddressOf? operator

[このトピックはプレリリース版のため将来変更される可能性があります。また、プレースホルダとしてブランクのトピックが含まれています。]

In Visual Basic 6.0, the AddressOf? operator was used to pass the address in
memory of a function to an API procedure that takes a function pointer as an argument.

In Visual Basic .NET, the AddressOf? operator must be used with a Delegate type.
Delegates allow Visual Basic .NET to maintain a pointer to a function even
if the function itself has already been garbage-collected.

The following example illustrates how a callback function that uses AddressOf? is upgraded:

' Visual Basic 6.0
Declare Function SetWindowLong Lib "USER32.DLL" Alias "SetWindowLongA" (ByVal
hwnd As Long, ByVal attr As Long, ByVal lVal As Long) As Long
Sub SubClassWindow(ByVal hwnd As Long)
  If PrevProcPtr = 0 Then
     PrevProcPtr = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf SubClassProc)
  End If
End Sub

' After upgrade to Visual Basic .NET
Declare Function SetWindowLong Lib "USER32.DLL"  Alias "SetWindowLongA"(ByVal
hwnd As Integer, ByVal attr As Integer, ByVal lVal As Integer) As Integer
Sub SubClassWindow(ByVal hwnd As Integer)
  If PrevProcPtr = 0 Then
     ' UPGRADE_WARNING: Add a delegate for AddressOf SubClassProc.
     PrevProcPtr = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf SubClassProc)
  End If
End Sub

What to do next
Add a delegate for the AddressOf? operator, and change the parameter of the function declaration to the Delegate type:

Delegate Function SubClassProcDelegate(ByVal hwnd As Integer, ByVal msg As
Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Declare Function SetWindowLong Lib "USER32.DLL" Alias "SetWindowLongA" (ByVal
hwnd As Integer, ByVal attr As Integer, ByVal lVal As SubClassProcDelegate) As
Integer
Sub SubClassWindow(ByVal hwnd As Integer)
   If PrevProcPtr = 0 Then
      PrevProcPtr = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf SubClassProc)
   End If
End Sub

See Also Other Resources

  • Delegates and the AddressOf? Operator
  • AddressOf? Operator
  • Delegate Statement

添付ファイル: fileFormsAuthSQLVWebDev2005exp.lzh [詳細]

トップ   編集 凍結解除 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: Mon, 06 Feb 2006 01:26:11 JST (4039d)