🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9569

COM object creation code

#9569
From: Ramon F Herrera
Date: Mon, 05 Jul 2004 01:43
44 lines
2433 bytes
I am a complete newbie in this area, having come from the
Unix/Java side of the fence.  My objective is to add custom
properties (columns) to the display and sorting of the
Windows Shell in "View Details" mode.

I already ordered the "Inside COM" book to get started.

Now the question:  In the following link, I found 5 blocks of code:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/shellcolhand.asp

The 4 last blocks are obviously valid C++ code, but the one that
has got me puzzled is the first block:

--------------------------------------------------------------------------
class CByteSize : public IUnknown,
                   public IPersist,
                   public IColumnProvider
{
     /* IUnknown */
     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvOut);
     STDMETHODIMP_(ULONG) AddRef();
     STDMETHODIMP_(ULONG) Release();

     /* IPersist */
     STDMETHODIMP GetClassID(CLSID *pclsid);

     /* IColumnProvider */
     STDMETHODIMP Initialize(LPCSHCOLUMNINIT);
     STDMETHODIMP GetColumnInfo(DWORD dwIndex, LPSHCOLUMNINFO psci);
     STDMETHODIMP GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, 
VARIANT *pvarData);
};
--------------------------------------------------------------------------

The above is supposed to "Create a Column Handler Object".
Is that C++ code or some sort of special COM metalanguage?
Should I just paste it into C++ Builder and compile it
somehow?

Thanks for your kind assistance,

-Ramon F Herrera
Technical Details
Message-ID: <40e8b226$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c9af22da94edfce4,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sun, 04 Jul 2004 21:43:04 -0400
From: Ramon F Herrera <ramon@jonjay.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: COM object creation code
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.61.5.41
Message-ID: <40e8b226$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1088991782 24.61.5.41 (4 Jul 2004 18:43:02 -0700)
Lines: 47
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail