Start a new topic

Intercepting the file open call to check Openflight version?

Original Post by: chrisell Mon Dec 7 21:19:08 2009

Does anyone know if there's a way to intercept the file open functions? We're in a situation where we'd like to be able to determine if a user is about to try to edit an older version openflight file with a new version of Creator. So for example if we see a v15.7 file being opened, we'd like to pop up a warning, or perform some other function.

It seems this might be possible by registering a different filetype or extension, but we want to do it on opening the regular .FLT files.

Original Post by: SteveThompson Mon Dec 7 21:31:16 2009

There is a "notification" mechanism available to Creator plugins that could help in this situation. See the API function mgRegisterNotifier and the specific Notifier Events called MNOTIFY_DATABASEOPENED and MNOTIFY_DATABASESAVED. After registering for these notifications - whenever a database is subsequently opened or saved, respectively, your plugin would get "notified" at which time you could take some appropriate action (pop up a warning, etc).

Original Post by: chrisell Mon Dec 7 21:45:22 2009

Good tip - thanks - we'll try that.

Login to post a comment