Question:

You write a class named Employee that includes the following code segment.

public ref class Employee

{

String= employeeId;

String= employeeName;

String= jobTitleName;

public:

String= GetName() { return employeeName; }

String= GetJobTitle() { return jobTitleName; }

You need to expose this class to COM in a type library. The COM interface must also facilitate forward-compatibility across new versions of the Employee class.

You need to choose a method for generating the COM interface.

What should you do?

 

A Add the following attribute to the class definition.
[ClassInterface(ClassInterfaceType::AutoDual)]
public class Employee { 

B Add the following attribute to the class definition.
[ComVisible(true)]
public class Employee { 

C Add the following attribute to the class definition.
[ClassInterface(ClassInterfaceType::None)]
public class Employee { 

D Define an interface for the class and add the following attribute to the class definition.
[ClassInterface(ClassInterfaceType::None)]
public class Employee : IEmployee { 

+ Answer
+ Report
Total Preview: 771

Copyright © 2024. Powered by Intellect Software Ltd