writing a program to interface with other programs
There must be some mechanism that windows provides that allows an application programmed in whatever language to interface with other programs running on the same computer.
Specifically, I will be beginning a project soon in which I have to program in Java an application that reads from a dxf file and produces a plan/model from it in AutoCAD. It needs some kind of I/O channel opened so as to send it instructions to AutoCAD (ex. draw line, make face, create new layer, etc.).
Does Windows have resources/mechanisms that allow one to do this in Java?
Re: writing a program to interface with other programs
It is going to be application dependent - if the application you wish to send information to doesn't listen for information sent to it then there isn't really a mechanism to do so. You could write a file in the format of said application, but it wouldn't be on the fly. Often, data is sent dynamically to an application via port/socket communication - so I recommend investigating whether AutoCAD has this capability.
Re: writing a program to interface with other programs
Thanks copeg, I will look into port/socket communication.
My first thought was that my Java application could somehow "borrow" the user input channels (i.e. keyboard and mouse) and send info as if it were the devices on those channels. Is this a possibility?
Re: writing a program to interface with other programs
Quote:
Originally Posted by
gib65
Thanks copeg, I will look into port/socket communication.
My first thought was that my Java application could somehow "borrow" the user input channels (i.e. keyboard and mouse) and send info as if it were the devices on those channels. Is this a possibility?
Have a look at the Robot class.
Robot (Java Platform SE 6)
No guarantees it will fit your needs, but it might be worth a quick test to see
Re: writing a program to interface with other programs
Too late, he already got help elsewhere and neglected to update this thread.
This thread has been cross posted here:
http://www.java-forums.org/advanced-java/50782-writing-program-interface-other-programs.html
Although cross posting is allowed,
for everyone's benefit, please read:
Java Programming Forums Cross Posting Rules
The Problems With Cross Posting
Re: writing a program to interface with other programs
Yes, I came across that myself. Looking into it. Thanks.
Re: writing a program to interface with other programs
Quote:
Originally Posted by
KevinWorkman
Doh! I forgot about being forward about cross-posting!!!
Sorry about that. I should know better - because I do know better.
I only forgot because I'm really anxious to figure out how to do this because my butt is on the line, and being forward about my cross-posts kinda slipped on my priority list (not to mention my memory) - that's no excuse, I realize, but for what it's worth: every answer I get is useful! I mean it: I've never come across an answer that was exactly the same as every other one.
So I do appreciate the time and information provided to me by those willing to give it.
And I promise I will remember to mention my cross-posts next time (I'm writing it on a sticky as we speak :D).