Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2005

Tip: Looking for answers? Try searching our database.

C# and Delphi Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Darryl A. J. Staflund - 11 Nov 2005 20:07 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.