 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
forums@mail.bg Guest
|
Posted: Sat Feb 05, 2005 11:26 am Post subject: want to make plugin, but only C++ SDK |
|
|
I want to make plugin for geoShell (win shell replacement), but
everything is in C++. I dont know where to start from, since I am not
making any plugins by now.
I talked in official geo IRC channel, and there tell me that it is
probably impossible to make it in delphi, because I must use some "C++
object" in my dll. I doubt that it is impossible, since this is
standart dll, but I am not made any stuff like that before and cant be
sure.
here is some links
http://geoshell.org/downloads/r4/GeoShell_SDK_1.zip
http://geoshell.org/
http://sourceforge.net/projects/geoshell/
could somebody look the SDK, and direct me
10x
|
|
| Back to top |
|
 |
Rob Kennedy Guest
|
Posted: Sat Feb 05, 2005 9:00 pm Post subject: Re: want to make plugin, but only C++ SDK |
|
|
[email]forums (AT) mail (DOT) bg[/email] wrote:
| Quote: | I want to make plugin for geoShell (win shell replacement), but
everything is in C++. I dont know where to start from, since I am not
making any plugins by now.
I talked in official geo IRC channel, and there tell me that it is
probably impossible to make it in delphi, because I must use some "C++
object" in my dll. I doubt that it is impossible, since this is
standart dll, but I am not made any stuff like that before and cant be
sure.
|
It will indeed be very difficult. The writers got is _almost_ right.
They used interfaces -- abstract classes -- to define a set of methods
that a plug-in object needs to implement, but they didn't use COM
interfaces. If they had, writing a plug-in in Delphi would be easy. As
it is, though, you cannot use Delphi's built-in interface support
because Delphi assumes COM. COM interfaces have three additional
functions (_AddRef, _Release, and QueryInterface) that GeoShell's
interfaces don't have, so when GeoShell tries to call a function on a
Delphi object, it would wind up calling the wrong method.
Another mistake the writers made was to use C++'s default calling
convention for the methods. The calling convention is actually not
specified by the C++ standard. In Visual C++, the default calling
convention is very similar to stdcall, but the reference to the object
is stored in the ECX register instead of at the top of the stack like
all the rest of the method's parameters. Fixing that is possible, but
not trivial. (If you decide to continue with the project of yours, I can
help you resolve the problem with the calling conventions since I've
done it before.)
A call these mistakes because the GeoShell developers were either
ignorant of the right way to make language-independent plug-in
frameworks or they thought they could make a simpler implementation of
COM without really appreciating all the things Microsoft had to put into
COM to make it compatible with multiple languages. Delphi supports
interfaces, COM, and DLLs, but only if the other end does them right.
I think your only hope is to write a skeleton plug-in in C++ and have it
wrap a more standard plug-in that you write in Delphi. Your first step
will be to find a C++ compiler that is compatible with the one used for
GeoShell. Some version of Visual C++ probably qualifies, and maybe GCC
will be OK, too. I might be able to provide some assistance in writing
the code, but I've never done anything with interfaces or COM in C++.
Ten times what?
--
Rob
|
|
| Back to top |
|
 |
Nicholas Sherlock Guest
|
Posted: Sat Feb 05, 2005 10:11 pm Post subject: Re: want to make plugin, but only C++ SDK |
|
|
[email]forums (AT) mail (DOT) bg[/email] wrote:
| Quote: | I talked in official geo IRC channel, and there tell me that it is
probably impossible to make it in delphi, because I must use some "C++
object" in my dll.
|
That sounds about right. What you *can* do is make an intermediate DLL
in C++ which exposes the object's methods and such to your Delphi
program using ordinary procedures and functions.
Cheers,
Nicholas Sherlock
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|