Programming Question Compiling an O2006 .dll to work in O2010

Columbia42

Member
Joined
Dec 4, 2009
Messages
884
Reaction score
0
Points
16
Location
C:\ProgramFiles\Orbiter
I'm trying to port a project from O2006 to O2010 and I can't get the spacecraft's .dll to work in O2010. Is there a set method of porting modules between versions or is the problem code specific?
 
I think it depends on just what code the .dll uses. I don't think there have been any API call removals, but I could be wrong. Is it a compilation problem, or is this a crash once it's been compiled into .dll problem? Or does something just not work once it's running in Orbiter?
 
The log says Orbiter can't load the specified module.
Is there an error code in the line saying that, like "(error code 14001)" or something?

Are you compiling the module from sources and launching Orbiter from inside of Visual Studio in debug mode?
 
I think it depends on just what code the .dll uses. I don't think there have been any API call removals, but I could be wrong. Is it a compilation problem, or is this a crash once it's been compiled into .dll problem? Or does something just not work once it's running in Orbiter?
Yes, some APIs were removed from 2010 (or at least they were removed from the '09 betas - which was the last coding that I did with orbiter). Specifically functions like InitModule replaced older depricated methods that were already deprecated in '06 but still implemented, so modules that used these interfaces still worked in '06. They do not in '10. I think they are still defined, but never get called. Look through the API docs for 'deprecated'. Take a look at InitModule as a start, see which function it replaced and then look at that function. Then use that knowledge to see what functions you are calling that are deprecated.
 
Yes, some APIs were removed from 2010 (or at least they were removed from the '09 betas - which was the last coding that I did with orbiter). Specifically functions like InitModule replaced older depricated methods that were already deprecated in '06 but still implemented, so modules that used these interfaces still worked in '06. They do not in '10. I think they are still defined, but never get called.
The opcDLLInit & opcDLLExit are still being called from Orbiter's InitLib function if they are found exported by the module and InitModule & ExitModule weren't found (from the quick look at disassembly of Orbiter 101016's InitLib function, and DllMain (entry point) of the module).
 
The opcDLLInit & opcDLLExit are still being called from Orbiter's InitLib function if they are found exported by the module and InitModule & ExitModule weren't found (from the quick look at disassembly of Orbiter 101016's InitLib function, and DllMain (entry point) of the module).
Those were the ones that I was thinking about. As I said, I haven't done any explicit '10 development, but I remember that the opcDLLInit wasn't called in some of the '09 betas (even if InitModule wasn't found). It may have changed since then, but it may be related to your problems.
 
VESSEL class is still supported. VESSEL2 and VESSEL3 just extend the VESSEL class. Just look in the API reference or VesselAPI.h header.
 
VESSEL class is still supported. VESSEL2 and VESSEL3 just extend the VESSEL class. Just look in the API reference or VesselAPI.h header.

VESSEL is indirectly not supported anymore, since most of the ovcXXXX callback functions of the DLL are no longer called.
 
This is very strange. I just checked the Orbiter log and it turns out the module that Orbiter can't load is not the one I wrote. As far as my spacecraft goes Orbiter does not report any errors yet the "disappearing spacecraft syndrome" persists. What would cause this? I'm pretty sure I'm not using any deprecated API functions other than set bank moment scale and set pitch moment scale and those, in my experience, don't cause something like this.
 
Is the linker's output path for the module set where it should be i.e. in Modules folder? Did you test your module in debugger?
 
The output path is correct and if it weren't the log would say that Orbiter couldn't load the specified module. I tried debugging the module but it was as if Orbiter was making no attempt to load the module (despite the info contained in the log) i.e. it didn't show up in the debugger's list of modules that Orbiter was loading. (It's certainly possible, however, that I could be doing something wrong in the debugger. I've never debugged an Orbiter addon before.)
 
The output path is correct and if it weren't the log would say that Orbiter couldn't load the specified module.
Have you created a configuration file for the vessel in "Config/Vessels" folder?
 
Yes. That error would also precipitate a "no vessel class configuration file for..." error. I've also substituted a different module (MMU) and renamed it so that my addon would load it instead. This loaded fine so the problem must be in the actual source code.
 
Is there an error code in that line saying the module couldn't be loaded?
 
No. Here's the Orbiter log (the addon is called Cosmos 47)

Code:
**** Orbiter.log
Build Aug 30 2010 [v.100830]
Timer precision: 3.5803e-010 sec
Found 0 joystick(s)
Devices enumerated: 9
Devices accepted: 7
==> RGB Emulation
==> Direct3D HAL
==> Direct3D T&L HAL
==> Direct3D HAL (ATI Radeon HD 5570)
==> Direct3D T&L HAL (ATI Radeon HD 5570)
==> Direct3D HAL (ATI Radeon HD 5570) #2
==> Direct3D T&L HAL (ATI Radeon HD 5570) #2
Module AtlantisConfig.dll .... [Build 100830, API 100830]
Module AtmConfig.dll ......... [Build 100830, API 100830]
Module DGConfigurator.dll .... [Build 100830, API 100830]
Module ScnEditor.dll ......... [Build 100830, API 100830]
Module LuaConsole.dll ........ [Build 100830, API 100830]
Module LuaMFD.dll ............ [Build 100830, API 100830]

**** Creating simulation session
DirectDraw interface OK
Direct3D interface OK
Graphics: Viewport: Window 1018 x 736 x 32
Graphics: Hardware T&L capability: Yes
Graphics: Z-buffer depth: 32 bit
Graphics: Active lights supported: 8
Loading 15382 records from star database
Module Sun.dll ............... [Build 100830, API 100830]
VSOP87(E) Sun: Precision 1e-006, Terms 554/6634
Module Mercury.dll ........... [Build 100830, API 100830]
VSOP87(B) Mercury: Precision 1e-005, Terms 167/7123
Module Venus.dll ............. [Build 100830, API 100830]
Module VenusAtm2006.dll ...... [Build 100830, API 100830]
VSOP87(B) Venus: Precision 1e-005, Terms 79/1710
Module Earth.dll ............. [Build 100830, API 100830]
Module EarthAtmJ71G.dll ...... [Build 100830, API 100830]
VSOP87(B) Earth: Precision 1e-008, Terms 2564/2564
Module Moon.dll .............. [Build 100830, API 100830]
ELP82: Precision 1e-005, Terms 116/829
Module Mars.dll .............. [Build 100830, API 100830]
Module MarsAtm2006.dll ....... [Build 100830, API 100830]
VSOP87(B) Mars: Precision 1e-005, Terms 405/6400
Module Phobos.dll ............ [Build ******, API 060425]
Module Deimos.dll ............ [Build ******, API 060425]
Module Galsat.dll ............ [Build 100217, API 100215]
Module Jupiter.dll ........... [Build 100830, API 100830]
VSOP87(B) Jupiter: Precision 1e-006, Terms 1624/3625
Module Io.dll ................ [Build 100217, API 100215]
Module Europa.dll ............ [Build 100217, API 100215]
Module Ganymede.dll .......... [Build 100217, API 100215]
Module Callisto.dll .......... [Build 100217, API 100215]
Module Satsat.dll ............ [Build 100215, API 100212]
Module Saturn.dll ............ [Build 100830, API 100830]
VSOP87(B) Saturn: Precision 1e-006, Terms 2904/6365
Module Mimas.dll ............. [Build 100215, API 100212]
SATSAT Mimas: Terms 113
Module Enceladus.dll ......... [Build 100215, API 100212]
SATSAT Enceladus: Terms 33
Module Tethys.dll ............ [Build 100215, API 100212]
SATSAT Tethys: Terms 101
Module Dione.dll ............. [Build 100215, API 100212]
SATSAT Dione: Terms 59
Module Rhea.dll .............. [Build 100215, API 100212]
SATSAT Rhea: Terms 68
Module Titan.dll ............. [Build 100215, API 100212]
SATSAT Titan: Terms 100
Module Iapetus.dll ........... [Build 100215, API 100212]
SATSAT Iapetus: Terms 605
Module Uranus.dll ............ [Build 100830, API 100830]
VSOP87(B) Uranus: Precision 1e-006, Terms 1827/5269
Module Miranda.dll ........... [Build ******, API 060425]
Module Ariel.dll ............. [Build ******, API 060425]
Module Umbriel.dll ........... [Build ******, API 060425]
Module Titania.dll ........... [Build ******, API 060425]
Module Oberon.dll ............ [Build ******, API 060425]
Module Neptune.dll ........... [Build 100830, API 100830]
VSOP87(B) Neptune: Precision 1e-006, Terms 391/2024
Finished initialising world
Module Cosmos47.dll .......... [Build 110404, API 100830]
Finished initialising status
Finished initialising camera
Finished initialising panels
Finished setting up render state
ERROR: DDraw object is still referenced: 1047
---------------------------------------------------------------
>>> ERROR: Destroy framework objects failed
>>> [OrbiterGraphics::Exit3DEnvironment | .\OGraphics.cpp | 1034]
---------------------------------------------------------------
**** Closing simulation session

As you can see Orbiter loaded the module fine but it does not display the spacecraft in the simulation.
 
Back
Top