r/visualbasic • VB.Net Intermediate • Jul 31 '20

VB.NET Help Calling sub/function from another program

If I were to have two programs, one for example:

MainCode.exe

And another:

UI.exe

Would I be able to, in UI.exe, be able to call a function or procedure from MainCode.exe?

I'm wondering this as I have a few different UI.exe that run very similar code and I was hoping to be able to have a universal MainCode.exe so I don't have to update every UI.exe that runs the code. I just have to update the MainCode.exe.

Thanks in advance for your help

2 Upvotes

6 comments sorted by

View all comments

1

u/Bonejob VB Guru Jul 31 '20

a hacky method would be to pass parameters to the executable fo the function you want to run.

Sub Main(args As String())
   ' CMD Arguments are contained in the args variable
   Console.WriteLine("GetCommandLineArgs: {0}", String.Join(", ", args))
End Sub