Question:

You write the following code to call a function from the Win32 Application Programming Interface (API) by using platform invoke.

int rc = MessageBox(hWnd, text, caption, type);

You need to define a method prototype.

Which code segment should you use?

 

A [DllImport("C:\\WINDOWS\\system32\\user32.dll")]
extern int MessageBox(int hWnd,
String= text,
String= caption, uint type); 

B [DllImport("user32")]
extern int MessageBox(int hWnd,
String= text,
String= caption, uint type); 

C [DllImport("user32")]
extern int MessageBoxA(int hWnd,
String= text,
String= caption, uint type); 

D [DllImport("user32")]
extern int Win32API_User32_MessageBox(
int hWnd, String= text, String= caption, uint type); 

+ Answer
+ Report
Total Preview: 597

Copyright © 2024. Powered by Intellect Software Ltd