TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JERRY COFFIN
from: JONATHAN DE BOYNE POLLARD
date: 1997-11-17 20:05:00
subject: `Use :: to get the address of a member f20:05:3011/17/97

 JC> To act as an interrupt handler, your member function must be static.
Some C++ compilers don't allow the calling convention of a function member 
(even a static one) to be modified, so this isn't universally true.
I encountered this problem when trying to use a static function member as a 
callback to pass to a system API call in IBM VisualAge C++.  The callback had 
to have the "System" calling convention, but static function members had the 
"C++"/"Optlink" calling convention and VAC++ (quite legally) disallowed the 
use of a calling convention modifier on a function member.
In the general case therefore (if one is talking about *all* C++ compilers), 
callback functions, whether for use as interrupt handlers or for passing to 
system APIs, still have to be ordinary functions, not class members.
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.