tag:blogger.com,1999:blog-7893310777906730197.post7542801504923743233..comments2023-03-31T10:20:37.768-04:00Comments on .NET Code Catto Blogger Blog: 70-536 MCTS .NET Question Samples #21Cattohttp://www.blogger.com/profile/01583612446043479068noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7893310777906730197.post-67327431073076735062010-06-07T07:26:49.025-04:002010-06-07T07:26:49.025-04:00You write the following code segment to call a fun...You write the following code segment to call a function from the Win32 Application Programming Interface (API) by using platform invoke.<br /><br />string personName = “N?el”;<br />string msg = “Welcome” + personName + “to club”!”;<br />bool rc = User32API.MessageBox(0, msg, personName, 0); <br /><br />You need to define a method prototype that can best marshal the string data. <br /><br />Which code segment should you use?<br /><br />a)<br />[DllImport("user32", CharSet = CharSet.Ansi)]<br />public static extern bool MessageBox(int hWnd, String text, String caption, uint type);<br />}<br /><br />or<br /><br />b)<br /><br />[DllImport("user32", CharSet = CharSet.Unicode)]<br />public static extern bool MessageBox(int hWnd, String text, String caption, uint type);<br />}<br /><br />I can't understand why the anser is B. Can you help me?Anonymousnoreply@blogger.com