🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
1 messages
1 total messages Started by bcrich999 Thu, 15 May 2003 14:08
Help with importing shell32 functions
#16411
Author: bcrich999
Date: Thu, 15 May 2003 14:08
46 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads