Article View: borland.public.cppbuilder.nativeapi
Article #9575Re: COM object creation code
From: Ramon F Herrera
Date: Mon, 05 Jul 2004 02:51
Date: Mon, 05 Jul 2004 02:51
68 lines
3147 bytes
3147 bytes
After reviewing the code in question, I guess it is indeed
valid and proper C++. Yet, it won't compile for me.
Perhaps I need some #include?
[C++ Error] CByteSize.cpp(3): E2303 Type name expected
The error messages in C++ Builder are just awful (compared
to JBuilder X). I should probably upgrade to C++ Builder X.
Still, any guidance or tips on how to get started with the shell
extensions are very much welcome.
Thanks,
-Ramon
Ramon F Herrera wrote:
>
> 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:
<40e8c24d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40e8b226$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c9af22da94edfce4 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 04 Jul 2004 22:51:59 -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: Re: COM object creation code References: <40e8b226$1@newsgroups.borland.com> In-Reply-To: <40e8b226$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.61.5.41 Message-ID: <40e8c24d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088995917 24.61.5.41 (4 Jul 2004 19:51:57 -0700) Lines: 69 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail