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?

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?

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 {



Leave a Reply 1

Your email address will not be published. Required fields are marked *


seenagape

seenagape

I have the same idea. D