June 7, 200322 yr I am trying to develop an application to modify the aircraft.cfg file through a VB GUI. Can anyone give me ideas or lead me to some documentation that could help me get started. Thanks,
June 7, 200322 yr Get the Aircraft SDK from Microsoft. It has most of the parameters that can go in the aircraft.cfg file.Matt Matt KaprockiFor fastest support, please submit a ticket at http://support.precisionmanuals.com
June 7, 200322 yr Pretty easy thing, you want to do. The hard thing--to code it considering all the parameters you have in a typical aircraft.cfg. I use a simple API call to read and write .txt files like .cfg and .ini files. It first must be declared with these statements (for both reading and writing)Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As LongDeclare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As LongHere's an example of the Write function in use:dummy = WritePrivateProfileString("flight_tuning", "elevator_effectiveness", "2.0", ".aircraft.cfg")Breaking this down into English, you'll recognize "flight_tuning" as the header of a section of an aircraft.cfg. "Elevator_effectiveness" is one of the variables within. "2.0" is the value I want to write, and the last is the filename I'm writing to.Only difference between writing the data and getting the data, is during the "get", you'll want to read the variable value into your program, to populate the appropriate field.Here is a breakdown of the variable meanings in the declaration:lpAppName$ Name of a Windows-based application that appears in the initialization file.(Note: For your purposes, this would be the name of the section heading, such as "flight_tuning")lpKeyName$Key name that appears in the initialization file.nDefault$Specifies the default value for the given key if the key cannot be found in the initialization file.lpFileName$ Points to a string that names the initialization file. If lpFileName does not contain a path to the file, Windows searches for the file in the Windows directory.lpDefault$ Specifies the default value for the given key if the key cannot be found in the initialization file.lpReturnedString$Specifies the buffer that receives the character string.(note: IOTW, this is the variable you store the string in)nSize% Specifies the maximum number of characters (including the last null character) to be copied to the buffer.lpString$ Specifies the string that contains the new key value.I hope this helps a bit....Regards,John
June 7, 200322 yr Save yourself some trouble and make sure what you want to do has not been done already and is available as freeware.
June 8, 200322 yr John,Thanks for the help. This is enough to get me started. I am not going to make anything for release until I can prove its' worth to me and it hasn't been done as freeware, well it might have been, but hasn't been done correctly yet. Thanks again for the help.
June 8, 200322 yr Along these lines, early this week I was looking at brining all of the aircraft.cfg data for all of the planes, not many right now since replacement of drive c, into an ACESS/Excel data file for quick and handy reference for use when adjusting the parameters.I decided if was too much work for a summer job. Everything is too much for summer. ;-)Regards,Bob
Create an account or sign in to comment