CPlusOOP
SiteMap
Advanced COM
Basic COM
Basic COM
«Prev
Next»
Com Fundamentals
Component Object Model
COM Specification
Terminology Com Objects
COM Method Property
COM Interface Properties
Interface Definition Language
Compiling IDL Files
Implementing COM Objects
iunknown Interface Navigation
iunknown Reference Counting
COM Type Library
COM Basics
COM Class Objects
iclassfactory Creates Objects
COM Servers
InProcess Com Servers
Creating COM Objects
In Process Com Server
Development Frameworks
Core ATL Classes
Generate ATL Process ComServer
Add COM Class
Adding COM
Examine ATL Code
ATL Project Files
phbook.idl-phbook.h
Designing Data Structures
Designing Methods
Adding Structures Constants
Add readWrite Property
Add Read Only
Add Interface Methods
Add Application Data
Coding COM Methods
Add Phone Record
COM Server Conclusion
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();
Use guidgen to generate a DEFINE_GUID macro and place the macro in your code.
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.