70-540VB TS Braindump
ExamSoon 70-540VB Exams
Microsoft
O rder : 70-540VB Exam
Practice Exam: 70-540VB
Exam Number/Code: 70-540VB
Exam Name:
Questions and Answers: 110 Q&As
Free 70-540VB Braindumps
Exam : Microsoft 70-540(VB)
Title : TS: Microsoft Windows Mobile Application Development
1. You create a Microsoft .NET Compact Framework application that interoperates with a native DLL.
The application calls the Microsoft Win32 EnumWindows API.
The native definition for EnumWindows contains the following code segment.
BOOL EnumWindows (
WNDENUMPROC lpEnumFunc ,
LPARAM lParam ;
)
The native definition for WNDENUMPROC contains the following code segment.
BOOL CALLBACK EnumWindowsProc (
HWND hwnd ,
LPARAM lParam ;
)
The Platform Invoke definition contains the following code segment.
<DllImport("Core.dll", SetLastError:=True)> _
Public Shared Function EnumWindows( _
ByVal lpEnumFunc As IntPtr, ByVal lParam As UInteger) As Boolean
End Function
The managed callback definition contains the following code segment.
Public Function EnumWindowsCallbackProc( _
ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
System.Diagnostics.Debug.WriteLine( _
("Window: " + hwnd.ToString()))
Return 1
End Function
You need to write a managed function that calls the native API.
Which code segment should you use?Reset Instructions Calculator.
A. Public Delegate Function EnumWindowsProc(ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
Public Sub InitializeCallback()
Dim callbackDelegate As New EnumWindowsProc( _
AddressOf EnumWindowsCallbackProc)
Dim callbackDelegatePointer As IntPtr = _
Marshal.GetFunctionPointerForDelegate(callbackDelegate)
EnumWindows(callbackDelegatePointer, 0)
End Sub
B. Public Delegate Function EnumWindowsProc( _
ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
Public Sub InitializeCallback()
Dim callbackDelegate As New EnumWindowsProc( _
AddressOf EnumWindowsCallbackProc)
Dim callbackDelegatePointer As IntPtr = _
Marshal.GetIDispatchForObject(callbackDelegate)
EnumWindows(callba