HighTechTalks DotNet Forums  

C# and Delphi Question

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss C# and Delphi Question in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Darryl A. J. Staflund
 
Posts: n/a

Default C# and Delphi Question - 11-11-2005 , 03:07 PM






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



Reply With Quote
  #2  
Old   
Marc Scheuner [MVP ADSI]
 
Posts: n/a

Default Re: C# and Delphi Question - 11-14-2005 , 06:50 AM






Quote:
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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.