How can I make a connection between two programs that were written in different languages? RRS feed

  • Question

  • I have two executable files, A and B, that were developed in different programming languages. I use A as my main program, and B as a program for licensing A. In the case that the user tries to access application A directly, I want my program to give an error saying that I should first open program B. If the user opens program B at first, and the license is approved, I need the program A to be opened with no errors. How can I do the connection between A and B?

    A application Delphi 

    B Application VB.Net


    Thursday, November 21, 2019 11:38 AM

All replies

  • Hello,

    I have not done any work in Delphi in years but would guess that you could use the following code in the .dpr project file to determine if the other application is running or not.

    If it were the other way around you would use to subscribe to MyApplication.Startup under project properties, Application tabe, "View Application events"

    Imports Microsoft.VisualBasic.ApplicationServices
    Namespace My
        Partial Friend Class MyApplication
            Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup
                If Not Process.GetProcesses().Any(Function(p) p.ProcessName.Contains("A")) Then
                    ' handle 
                End If
            End Sub
        End Class
    End Namespace

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    • Proposed as answer by Anonimersder Tuesday, November 26, 2019 7:34 AM
    Thursday, November 21, 2019 12:11 PM
  • Thank you for answering, This is what I needed ^^
    Thursday, November 21, 2019 12:31 PM
  • I suggest you read How can I make sure my program is launched only from my helper program and no other parent?

    Without some kind of "handshake", it would be a simple thing to rename a copy of Notepad as program B, run it and then manually start program A.

    Thursday, November 21, 2019 12:57 PM
  • Thank you for answering, This is what I needed ^^


    Did you resolve the issue? If you have resolved the issue then please mark the post or posts that helped you as The Answer by using the Mark as Answer link at the bottom of the post. Marking answers will help other community members find solutions in the future.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 22, 2019 7:38 AM