dfournie Posted November 9, 2005 Report Posted November 9, 2005 Pete, We use several hardware devices in one of our applications that FS2004 provides the info (through FSUIPC) to. Each device comes from its vendor with an API so that we can control the device in software we develop (in c++). The APIs provide a header file (.h) with function definitions that we include in our software, a library file (.lib) that we link to, and a DLL (.dll) file that we run with. If we want Flight Simulator to run an application that we provide the DLL for, what do we need to do in Flight Simulator? For instance, the DLL has one function - how does Flight Simulator know the name of the function so it can call it? Or does the DLL need to be defined in such a way that Flight Simulator doesn't need to know the name of the function? That way every time FS starts my .DLL would properly load/execute. This is what PFC.DLL does using the serial port.
Pete Dowson Posted November 9, 2005 Report Posted November 9, 2005 The APIs provide a header file (.h) with function definitions that we include in our software, a library file (.lib) that we link to, and a DLL (.dll) file that we run with. If we want Flight Simulator to run an application that we provide the DLL for, what do we need to do in Flight Simulator? For instance, the DLL has one function - how does Flight Simulator know the name of the function so it can call it? The DLL you use for your API is specific to your process. It will not be an FS DLL. Just because both programs use such libraries please do not be fooled into thinking that any program can use anyone else's library (DLL). It cannot unless specifically written to do so, and I doubt that you can persuade Microsoft to change FS to use your DLL. Or does the DLL need to be defined in such a way that Flight Simulator doesn't need to know the name of the function? DLLs used as FS Modules are written especially to be DLLs that run as modules in FS. They are not any-old library from any other project which are just tarted-up and plonked into the Modules folder. The nearest thing to an FS Module which is fully documented is an FS Gauge -- in fact a Gauge is merely a DLL which is loaded with a panel. If you learn to write FS gauges in C you will not be far off being able to write a Module. Regards, Pete
Pete Dowson Posted November 9, 2005 Report Posted November 9, 2005 That way every time FS starts my .DLL would properly load/execute. I should have answered this part too. You can add parameters to FSUIPC.INI to make FSUIPC load your program for you. See the section in the Advanced User's guide on this. There's also a utility, made by Jose Oliveira, available on the http://www.schiratti.com/dowson page to help. Regards, Pete
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now