Question:You write the following code to call a function from the Win32 Application Programming Interface (API) by using platform invoke.
Dim r As Integer = MessageBox(hWnd, strText, strCaption, strType)
You need to define a method prototype.
Which code segment should you use?
 

A <DllImport("user32")>_
Function MessageBox( _
ByVal hWnd As IntPtr, ByVal text As String, _
ByVal Caption As String, ByVal t As UInt32) As Integer End Function 

B <DllImport("C:\WINDOWS\system32\user32.dll ")>_
Function MessageBox( _
ByVal hWnd As IntPtr, ByVal text As String, _
ByVal Caption As String, ByVal t As UInt32) As Integer End Function 

C <DllImport("user32")>_
Function Win32API_User32_MessageBox ( _
ByVal hWnd As IntPtr, ByVal text As String, _
ByVal Caption As String, ByVal t As UInt32) As Integer End Function 

D <DllImport("user32")>_
Function MessageBoxA( _
ByVal hWnd As IntPtr, ByVal text As String, _
ByVal Caption As String, ByVal t As UInt32) As Integer End Function 

+ Answer
+ Report
Total Preview: 794

Copyright © 2024. Powered by Intellect Software Ltd