OOPortal OOPortal


Basic COM  «Prev  Next»

Defining COM interface in C++ - Exercise

Objective: Write a C++ class definition to implement a COM interface.

Exercise scoring

This exercise is worth a total of 10 points; up to 2 points for part 1, and up to 8 points for part 2.

Instructions


COM interface IMyComInterface has the following methods:

HRESULT Fx1(CHAR *buf);
HRESULT  Fx2();

  1. Use guidgen to generate a DEFINE_GUID macro and place the macro in your code.
  2. Write a C++ class definition to define a C++ implementation class for IMyComInterface.

Exercise submission

Write or paste your answer is the text area below. When you are done, click Submit to submit your answer.