Importing Arduino sketches to Eclipse (C/C++)

Then is it okay if I do something like this?

  1. Run the code first from the Arduino IDE to establish the connection
  2. Run the "digitalWrite" statement from my C/C++ code within another running app on my Desktop?

Is that okay?
Thanks~