Running function of one application from within another application
pI've got two standalone applications: First one: /p precode Namespace
FirstApplication Class MainWindow Public Sub New() InitializeComponent()
End Sub Public Function RunBatch(Parameter as String) as Double 'Do some
work Return SomeValue End Function End Class End Namespace /code/pre
pSecond application:/p precode Namespace SecondApplication Class
MainWindow Public Sub New() InitializeComponent() End Sub Public Sub
RunBatch() 'Call RunBatch() from first Application, get show the result
Msgbox(RunBatch) End Function End Class End Namespace /code/pre pBoth are
WPF, .Net 4.0 based. The goal is to have second application call on the
first one and execute a function in it. /p pThe key part is that both
applications are used primarily independently and only occasionally second
calls on the first. Because both applications need to exist as executable,
I don't want to solve the problem by creating a dll of the first
application - I would need to maintain both the executable and dll update
to date with potentially disastrous consequences if they fall out of
sync./p pSo the question is whether it's possible, to create an instance
of first application within AppDomain of the second one and, crucially,
execute functions of that instance./p
No comments:
Post a Comment