Article View: borland.public.cppbuilder.nativeapi
Article #16411Help with importing shell32 functions
From: bcrich999
Date: Thu, 15 May 2003 14:08
Date: Thu, 15 May 2003 14:08
46 lines
2823 bytes
2823 bytes
I was wondering if anyone could help me out with any of the following
3 problems (I am not new to C++, the winapi, or the shell, but just
started using C++ Builder a couple of days ago, and ran into some
minor problems). To make my questions a little more clear, I've
included an equivalent of what I want to do using Delphi code)
1 : I'm trying to declare external functions from shell32 (ILCombine
and others). Since some are not exported by name, I have to use
LoadLibrary and GetProcAddress functions. The problem is that I have
to use ILCombine (as well as others) in multiple modules, and I do not
want to do use LoadLibrary, etc eveyrtime. While I can probably get
away with making a class or file that contains a bunch of
functions/methods to wrap this, I figured it would be easier if I
could declare it in a similar way to other extern "C" declarations.
In delphi, the equivalent is:
function ILCombine(pidl1 : PItemIDList; pidl2 : PItemIDList):
PItemIDList;
stdcall; external 'shell32.dll' index 25;
Is there anything similar in C++ Builder?
2 : I want to use some COM objects that are not defined in .h files.
I know the GUIDs of these, and I know the functions and their
signatures, but I do not know how to declare them. Once again, using
a delphi example, I'll show you what I would like to do:
{$EXTERNALSYM ISomeComObject}
ISomeComObject = interface(IUnknown)
['{....a guid........}']
function blah(x : Integer): HResult; stdcall;
end;
3 : I have included <CommCtrl.h>, but some of the constants that are
defined in it (such as LVM listview messages) do not show when i use
Ctrl-Space to auto-complete. I can type them in myself, and it will
compile fine, but I am not sure why it doesn't show up in the IDE's
autocomplete list (or whatever it's called). Does anyone have similar
problems? Is there a .hpp file I should use instead?
If anyone can answer any of these questions, it would be greatly
appreciated. Thanks
Technical Details
Message-ID:
<45989533.0305150608.7c30d8be@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,301a037eac32744a,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-15 07:08:34 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: cygnusx999@hotmail.com (bcrich999) Newsgroups: borland.public.cppbuilder.nativeapi Subject: Help with importing shell32 functions Date: 15 May 2003 07:08:33 -0700 Organization: http://groups.google.com/ Lines: 46 Message-ID: <45989533.0305150608.7c30d8be@posting.google.com> NNTP-Posting-Host: 68.18.34.8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1053007713 17927 127.0.0.1 (15 May 2003 14:08:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 May 2003 14:08:33 GMT