Hi there,
I want to develop a C# plugin for a Delphi application that I use but do not
know too much about interop. I think it should be possible but I am just
not sure where to start. Can someone give me points on where I can find the
information I need to get started?
The plug-in initialization process is as follows:
1. During startup of the Delphi application, the application scans all
DLLs residing in the /plugins directory.
2. If a DLL in this directory exposes a method with a given signature,
the method is called to initialize the plugin.
An example Delphi signature would be as follows:
function IdentifyPlugIn (ID: Integer): PChar
Sound straightforward. I have to deal with the following as well:
3. Certain methods are tied to the application's even model and will be
called when certain events occur. An
example would be:
procedure OnCreate ()
4. I can register one or more callback methods with the application.
This is the business logic of the app. The method used to register the
callbacks would look something as follows:
Var
IDE_MenuState: procedure (ID, Index: Integer; Enabled:
Bool); cdecl;
IDE_Connected: function: Bool; cdecl;
IDE_GetConnectionInfo: procedure (var Username, Password,
Database: PChar); cdecl;
IDE_GetBrowserInfo: procedure (var ObjectType, ObjectOwner,
ObjectName: PChar); cdecl;
procedure RegisterCallback (Index: Integer; Addr: Pointer);
cdecl;
begin
case Index of
10: @IDE_MenuState := Addr;
11: @IDE_Connected := Addr;
12: @IDE_GetConnectionInfo := Addr;
13: @IDE_GetBrowserInfo := Addr;
end;
If anyone could direct me to the appropriate docs that will guide me through
the implementation of this I would be grateful.
Cheers,
Darryl
Marc Scheuner [MVP ADSI] - 14 Nov 2005 11:50 GMT
>I want to develop a C# plugin for a Delphi application that I use but do not
>know too much about interop.
Are you talking about creating C# (.NET) plugins for a Delphi .NET
app? Or for a Delphi / Win32 app?
If you want to extend the Delphi/Win32 app, you would need to create
COM object DLL's in C#, and those can't be simply scanned and
instantiated, normally you would have to register all of those in the
registry (using RegAsm), and go from there.
Marc
================================================================
Marc Scheuner May The Source Be With You!
Berne, Switzerland m.scheuner -at- inova.ch