Jump to content
Sign in to follow this  
mgh

Running BGLCOMP from another application

Recommended Posts

I'm developing an application that will run BGLCOMP using the ShellExecuteEx() function.I can do this but it appears not to find the files if the paths to BGLCOMP and/or the .xml files have a space in them EG if the paths include "Program Files". Could this be a DOS hangover?Is anyone else aware of this or am I doing something wrong?

Share this post


Link to post
Share on other sites

All you need to do is place quotes around the path. ie:bglcomp "E:Top DirectoryXMLFilename.xml"Also, ensure that bglcomp.exe and bglcomp.xsd are in the application directory.George

Share this post


Link to post
Share on other sites

Thanks, but your suggestion doesn't seem to work programatically. It may work in the Command Line.I am creating my path as a string and assigning the string to the lpFile member of the SHELLEXECUTEINFO structure. I get the same error message with and without additional quotes as follows:Windows cannot find '"C:T estbglcomp.exe"'Windows cannot find 'C:T estbglcomp.exe' It works perfectly with the space removed from Test.My workround is to use the current directory by omitting the path and not setting the lpDirectory member of SHELLEXECUTEINFO. This requires the .xml and .bgl files to be in the same directory as my application which is a minor, but annoying, limitation.

Share this post


Link to post
Share on other sites

This works fine for me: CString Command = "BGLCOMP.EXE "" + m_Filename + "" >> t.txt"; system(Command);George

Share this post


Link to post
Share on other sites

Thanks. I hadn't thought of using system :(I'll try it tomorrow - it's also simpler than the ways I've been trying.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...