Skip to Content
Learning DCOM
book

Learning DCOM

by Thuan L. Thai
April 1999
Intermediate to advanced
502 pages
15h 5m
English
O'Reilly Media, Inc.
Content preview from Learning DCOM

Event Sinks

Now that you have the ChatServer component in place, you’ll build the ChatClient component. As shown earlier in Figure 10-2, this component implements a COM object that is an event sink that will receive all messages fired off by the event source object in the ChatServer component. Specifically, as soon as the ChatServer component receives a chat message, it sends the same message back to all connected ChatClients through the client’s event sink object, shown in Figure 10-2 as CoMsgSink. The CoMsgSink object supports a callback interface called IReceiveMessage that the ChatServer component can utilize to make callbacks. Recall that you’ve defined this interface earlier in the last section, but you haven’t implemented it. You’ll do that in this section.

Besides implementing an event sink in this section, you’ll see the special contribution of this chapter in the subsection on Joining and Leaving a Chat Discussion where you contact the ChatBroker to find a ChatServer. You get a handle to the ChatServer via an interface pointer. Remember that this interface pointer is passed from the ChatServer to the ChatBroker to the ChatClient in the form of an OBJREF, and an OBJREF is the key that opens up distributed computing.

Creating the ChatClient Project

Our goal in this section is to develop a client application that looks similar to the one shown in Figure 10-3. So let’s use the MFC AppWizard EXE to create a Dialog base application and name this project ChatClient.

Creating the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Windows 7 Device Driver

Windows 7 Device Driver

Ph.D. Ronald D. Reeves

Publisher Resources

ISBN: 9781449307011Errata Page