How do I launch celestia using visual basic?

Post requests, images, descriptions and reports about work in progress here.
Topic author
ar81
Posts: 61
Joined: 13.06.2005
With us: 19 years 5 months

How do I launch celestia using visual basic?

Post #1by ar81 » 21.06.2005, 08:50

How do I launch Celestia from VB?
I tried the VB manual but it's huge and I can't find how to launch external apps.

bcelestia
Posts: 28
Joined: 19.01.2004
With us: 20 years 10 months

Post #2by bcelestia » 21.06.2005, 09:52

Hi,

You could try a statement such as

Ret = Shell("C:\Program Files\Celestia\celestia.exe", vbMaximizedFocus)


Bcelestia
B. Lambe

Topic author
ar81
Posts: 61
Joined: 13.06.2005
With us: 19 years 5 months

Post #3by ar81 » 21.06.2005, 14:02

Any parameters? I was thinking that it could be nide if you could automate access to Celestia by creating external VB app.

My idea was to ressemble a spaceship panel that would cause Celestia to move. The activities add-ons could be launched that way instead of being just a DOC with hyperlinks.

I know Celestia is not a sim, but I think it feels it has more cach?© and it could be more user friendly if you launched from a VB EXE form as if it was a spaceship control panel.

Topic author
ar81
Posts: 61
Joined: 13.06.2005
With us: 19 years 5 months

Post #4by ar81 » 21.06.2005, 14:49

I'm getting an error...

Dim Ret as Variant
Ret = Shell ("D:\Program Files\Celestia\celestia.exe", 3)

Path is Ok, Ret is variant... but I get a message:

"Fatal Error. Error reading configuration file"

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 1 month
Location: Rome, Italy

Post #5by piellepi » 22.06.2005, 09:29

Hi ar81!
it's easy to solve the problem.
Visual Basic (the programming environment I love :D and use since release 1 :D ) considers the current path as the one in which you put source files.
So celestia cannot find its configuration file.
You must change your code to

Dim Ret As Variant
ChDir "d:\Program files\Celestia" 'the path where you installed Celestia
Ret = Shell("celestia", 3) 'without any path at all!

or even better

ChDir "d:\Program files\Celestia"
Shell "celestia", 3

without unnecessary return codes.

et voil?  8O

Ciao!
Pierluigi

Topic author
ar81
Posts: 61
Joined: 13.06.2005
With us: 19 years 5 months

Post #6by ar81 » 23.06.2005, 14:50

Ok, I got to open Celestia. I want to issue commands from my VB form. How do I do that?

I learned how to get rid of the border and I made a skin for the control panel and buttons.

As I push the Power on buton and Celestia starts, I lose focus of my panel. Is there a way to recover it?


Return to “Add-on development”