🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2967

Re: C++ vs. Windows

#2967
From: Whiteside S D B
Date: Fri, 31 May 1991 09:27
23 lines
1400 bytes
Reply to: question about handling messages in C++ vs. TPW's "dynamic" methods

I use my own C++ library for windows and deal with messages in the following way:

I have the derived class declare a static array of pairs: <windows message><member function>

The array contains only those messages a derived class is interested in responding to. 

The "top-level" class, I call it "window", has a WndProc loop that received messages and
checks in the array whether the derived class wishes to receive them. If so it calls
the function specified in the array.

I use a technique called "bloom filtering" to decide whether the message received by WndProc
is in the array. This is a technique used, for example, by Credit Card companies when
checking if a card number is in a "wanted" list.

The technique has a high success rate, so the system performance is not degraded too much.

Hope the above is suggestive!

Regards,

Simon Whiteside
Technical Details
Message-ID: <5228@servax0.essex.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!servax0!sersun1!whisd

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!servax0!sersun1!whisd
From: whisd@sersun1.essex.ac.uk (Whiteside S D B)
Newsgroups: comp.windows.ms.programmer
Subject: Re: C++ vs. Windows
Message-ID: <5228@servax0.essex.ac.uk>
Date: 31 May 91 09:27:38 GMT
Sender: news@servax0.essex.ac.uk
Reply-To: whisd@essex.ac.uk (Whiteside S D B)
Organization: University of Essex, Colchester, UK
Lines: 23