Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete,

With regard to FS2004. Can you suggest a way of determining the current user default .flt path (i.e. current user "My Documents...")? I realize I can save and load a FS .flt without specifying the path and FSUIPC will use the default .flt path automatically, and that works great. What I need is the current user's default path so I can use SendMessage to populate a listbox for selection of existing flights. This works quite well with a specified path, but I need to determine the user path automatically. I see I can get the path of the currently loaded flight, but I have no way of being sure that the flight was loaded from the default .flt folder.

Any suggestions?

Thank you,

James (Trying very hard not to confuse or frustrate you )

Posted

With regard to FS2004. Can you suggest a way of determining the current user default .flt path (i.e. current user "My Documents...")?

The only way I know is to use the SHGetFolderPath API with "CSIDL_PERSONAL". This is in the SHFolder.DLL, which is included with FS and is probably standard in WinXP in any case.

That gets you to the correct personal documents folder. Then you have to append the "Flight Simulator Files" bit, in the language FS is actually using. If you are happy only to work with an English/American version then that's not a problem, but AutoSave has to do it properly -- it reads the FS folder name as a Resource from the FS Language.DLL -- after loading the Library you have to LoadString #36864 from it.

Regards,

Pete

Posted
Thanks Pete, I'll give it a go. Do you forsee any problems doing this across a network using the FS path to SHFolder.DLL? I'll start experimenting...

Ah, you won't be able to do that across a Network -- SHFolder, assuming it runs on the Networked PC will give you the personal folder path on that PC. I don't know any way of doing it remotely. It would be easier simply to key it in as a user-entered parameter, or share it with a known name.

Regards,

Pete

Posted

Pete,

Ah, you won't be able to do that across a Network...

Ah, rats. I was hoping that wasn't the case. You are no doubt dreading the next question , any chance you could add that path to a readable offset in a future release of FSUIPC? I'll make it user configurable for now.

Thanks Pete!

Posted
Ah, rats. I was hoping that wasn't the case. You are no doubt dreading the next question , any chance you could add that path to a readable offset in a future release of FSUIPC? I'll make it user configurable for now.

Well, currently FSUIPC doesn't know it. It doesn't need to know it. Also I'm reluctant to lose another 256 bytes to such an obscure need. Are you sure you can't do it another way? A diddy utility program running on the FS PC could get it and send it.

It isn't ever going to change unless another user logs in in any case, so having another 256 bytes of offset wrapped up in unchanging data seems rather wasteful.

The best thing to do is actually share it with a fixed known name, then your remote program can have that known name built in.

Regards,

Pete

Posted
Yes, ok, no problem. I'll write a stub for FS or use the shared name approach or something. Thanks for all the info!

No promises, yet, but I am now looking at dedicating a 256 byte area to

string replies to a series of requests for path type data. So far there are

only two of this type -- yours for the path to the FS default FLT folder, and another for the path corresponding to the Traffic ID used in the TCAS tables. But there will no doubt be more needs in the future, so it may be time for a generic solution.

I think if I design a system of requests + answers, allowing a variety of

types of reply, I can justify the offset space needed.

I shall probably re-use some global space which appears currently useless in any case, e.g. 1000 - 10FF.

I'll do some further investigation into all this and get back to you some

time, maybe this week, possibly with a test version. Okay? If I do this it will work with WideFS too, of course.

Regards,

Pete

Posted

Hi Pete!

I'll do some further investigation into all this and get back to you some

time, maybe this week, possibly with a test version. Okay?

Yes! That would be fantastic!!! I'll be here, no hurry! :D

James

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.