1

Our java program is suppose to call a program created by our vendor in C#. We are given two files

1.An exe file

2.An xml file...which its contents go something like this

<doc>
  <assembly><name>someProgram</name></assembly>
  <members>
    <member name="P:SomeConnector.callSomeOtherProgram()">
      <summary>a method to connect to some program</summary>
      <remarks></remarks>
    </member>
  </members>
</doc>

We're clueless on how to so this. Anyone got ideas?

5
  • do what? what is needed to do? run a command line in java? or just run the program? Commented Dec 8, 2014 at 8:03
  • i edited my post. the exe file contains functions and our java program is suppose to call it rather than manually start the exe file and use its wizard to do things Commented Dec 8, 2014 at 8:06
  • so now you got me REALLY confused. if you have an exe file, that's a run program, that means you can run it, with or without parameters, but not call a function on it like a class library. maybe the exe gets the xml as parameter? Commented Dec 8, 2014 at 8:09
  • running the exe manually (double click) shows up a wizard with an input text field and some buttons which does different tasks. the idea is for our java program to automatically run it and provide the fields and execute which buttons we would like to trigger to do the function we want. the java program just automates whatever is done manually Commented Dec 8, 2014 at 8:20
  • That xml file looks a little bit like an attempt at providing you with documentation about the program. You haven't provided any details about how the exe is supposed to be used.. (command line arguments? Standalone from within your program?) Commented Dec 8, 2014 at 8:52

1 Answer 1

1

for running comman line in java use:

Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("MyOtherProg.exe progParameter1 progParameter2");

judging by your comment and question i think you have a class library, and the right way to approach this would be to just create your own C# program that calls the different method on that class library using the given xml as a program args or other way

Edit

your comment:

unning the exe manually (double click) shows up a wizard with an input text field and some buttons which does different tasks. the idea is for our java program to automatically run it and provide the fields and execute which buttons we would like to trigger to do the function we want. the java program just automates whatever is done manually

answer:

ok, now we're coking with fire :)

so, at this point i would go to the vendor and ask if i can get a class library instead of the current ui, as you want it running automatically, without Human intervention. while on it i would check if you got other .dll files with the program. if so investigate them using VS.

one last thing, if all is turn bad and you have to do clicks, it's not lost yet, but at this point you have a lot of work, and i can't help you from here, but i'll send you to a link to start what you need and you'll explore from there:

Sign up to request clarification or add additional context in comments.

7 Comments

thanks but what about how to call its different functions? lets say i want to call "dotask1" now and "dotask2" later
running the exe manually (double click) shows up a wizard with an input text field and some buttons which does different tasks. the idea is for our java program to automatically run it and provide the fields and execute which buttons we would like to trigger to do the function we want. the java program should automate whatever is done manually. can this be done?
@lecarpetrondookmarion i've edited the answer adding the links to the mouse robot. please accept the answer if it helped you
yeah thats what ive been thinking too. it would be easier if they just provided us with a .dll file instead. just wondering if calling functions in an exe file is just the same as how java calls functions in a .dll file
@lecarpetrondookmarion i do not know of a way to do it, but maybe there is. however, the best way is to talk to the vendor
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.