🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools
Article #582

Re: How BWCPP knows PTwindow == *Twindow?

#582
From: Steven Sinofsky
Date: Thu, 15 Oct 1992 20:33
39 lines
1841 bytes
In article <Bw4IMt.JMx@news.cso.uiuc.edu> smlg1015@uxa.cso.uiuc.edu (Stuart M Lichtenthal) writes:
>I have been through every #include file in a typical
>Borland C++ example program which uses PTWindow or
>PTWindowsObject and I still don't see how the compiler
>knows that the P stands for "pointer".  This is certainly
>Hungarian notation, but I don't see where the "P" is
>defined.  I did see where TWindow and TWindowsObject classes
>are defined, though (WINOBJS.H).
>
>PTWindow is not in the "help" list. 
>
>Could somebody clear this up for me?
>
>Stuart Lichtenthal smlg1015@uxa.cso.uiuc.edu

Part of the benefits of "macro magic".  The _CLASSDEF macro defines
a bunch of pointer and reference types for a C++ class.  He is a brief
excerpt from the file \borlandc\include\_defs.h


// From the file \borlandc\include\_defs.h

#if defined( __cplusplus )
#  define _PTRDEF(name) typedef name _FAR * P##name;
#  define _REFDEF(name) typedef name _FAR & R##name;
#  define _REFPTRDEF(name) typedef name _FAR * _FAR & RP##name;
#  define _PTRCONSTDEF(name) typedef const name _FAR * PC##name;
#  define _REFCONSTDEF(name) typedef const name _FAR & RC##name;
#  define _CLASSDEF(name) class _CLASSTYPE name; \
        _PTRDEF(name) \
    _REFDEF(name) \
    _REFPTRDEF(name) \
    _PTRCONSTDEF(name) \
    _REFCONSTDEF(name)
#endif
-- 
Steven Sinofsky
stevesi@microsoft.com
Disclaimer: I don't speak for Microsoft, BillG does that.
Technical Details
Message-ID: <1992Oct15.203351.25693@microsoft.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!wingnut!stevesi
References: <Bw4IMt.JMx@news.cso.uiuc.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!wingnut!stevesi
From: stevesi@microsoft.com (Steven Sinofsky)
Subject: Re: How BWCPP knows PTwindow == *Twindow?
Message-ID: <1992Oct15.203351.25693@microsoft.com>
Date: 15 Oct 92 20:33:51 GMT
Organization: Microsoft Corporation
References: <Bw4IMt.JMx@news.cso.uiuc.edu>
Lines: 37