Sign in to follow this  
Guest ceo1944

Why would this work in FS9 but not FSX?

Recommended Posts

Just for grins I moved the FS9 airplane I'm debugging over to FSX to see what would happen...and 98 percent of it worked without a hitch! That's great news, but I have one perplexing mystery.I have a C gauge that reads a config file. It works just fine in FS9. But in FSX, it won't find its configuration file. Here's the part of the code that opens the file: GetCurrentDirectory(256, HomeDirectory); Ifile = fopen("./acme/acme.cfg", "r"); if (Ifile == NULL) return (-1);Now, there's an acme.cfg file all set up and waiting in the acme folder which I put under the main FSX folder. HomeDirectory shows the right path to the default folder. Yet under FS9 this works great, and in FSX it always returns -1. Same computer, same compiled gauge, same everything except FS9 vs FSX.Anyone have any ideas?ThanksDutch

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Check the path your gauge dll is loaded in. It's no longer the FSX root folder. In other words... GetCurrentDirectory isn't "C:Program FilesMicrosoft GamesFSX"

Share this post


Link to post
Share on other sites

I figured it out...I thought I'd tried everything before posting here but noooooooo. The problem was that the filename in the fopen() call is treated by windows as *case-sensitive* ... something I didn't know since filenames aren't case-sensitive in Windows. I'd created my directory as 'Acme' instead of 'acme'. Once I changed that, it found it - in the FSX root folder no less.Now it's crashing FSX, but that's obviously another problem...sure would be boring if everything worked right the first time wouldn't it?

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