PrepAway - Latest Free Exam Questions & Answers

What should you do to achieve your goal in these circumstances?

You work as the application developer at Domain.com. You create a new class named User.
The User class contains this code segment:
public class User {
string userId, userName, jobTitleName;
public string GetName() { return userName;
}
public string GetTitle() { return jobTitleName;
}
You want to expose the User class to COM in a type library.
You also want the COM interface to facilitate forward-compatibility across new versions of the User class.
What should you do to achieve your goal in these circumstances?

PrepAway - Latest Free Exam Questions & Answers

A.
Include this attribute with the class definition:
[ClassInterface(ClassInterfaceType.None)]public class User {

B.
Include this attribute with the class definition:
[ClassInterface(ClassInterfaceType.AutoDual)]public class User {

C.
Include this attribute with the class definition:
[ComVisible(true)]public class User {

D.
Specify the interface for the User class and then add this attribute with the class definition:
[ClassInterface(ClassInterfaceType.None)]public class User : IUser {

One Comment on “What should you do to achieve your goal in these circumstances?


Leave a Reply