Jump to content
Sign in to follow this  
Rocky

Fs9 Modules With Vista

Recommended Posts

I have developed a DLL module for fs9 (a DLL that is placed in the "Modules" directory of fs9, DLL that is loaded when fs9 starts) and it runs perfect on my system that runs Windows XP. Some other people also use this module without any problem with XP.But a friend of mine has Vista 32. He also uses this module without problem, except the error he gets when he quits fs9. At this time, he gets an error window that reports an error in XXX.dll_unloaded, where XXX.dll is the name of my module file.I don't understand this because I don't have such a module name. I don't understand why it works perfect on XP and crashes on Vista.Do I need to change anything in my code to make it work with Vista?Is there any Vista-specific action that must be done when the DLL_PROCESS_DETACH event occurs?Any help is welcome.Eric

Share this post


Link to post
Share on other sites
Do I need to change anything in my code to make it work with Vista?Is there any Vista-specific action that must be done when the DLL_PROCESS_DETACH event occurs?Any help is welcome.Eric
Eric, somewhere Tim Gregson (MS/ACES) mentioned some specific options that must be used when compiling to make the .dll "Vista compliant" but I'll be darned if I can find his post now... :( IIRC, it was in a thread at http://fsdevelopers.com some months ago... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

I have a module that operates under Vista without any special modifications.I'm uncertain why any would be needed to begin with.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
I have developed a DLL module for fs9 (a DLL that is placed in the "Modules" directory of fs9, DLL that is loaded when fs9 starts) and it runs perfect on my system that runs Windows XP. Some other people also use this module without any problem with XP.But a friend of mine has Vista 32. He also uses this module without problem, except the error he gets when he quits fs9. At this time, he gets an error window that reports an error in XXX.dll_unloaded, where XXX.dll is the name of my module file.I don't understand this because I don't have such a module name. I don't understand why it works perfect on XP and crashes on Vista.Do I need to change anything in my code to make it work with Vista?Is there any Vista-specific action that must be done when the DLL_PROCESS_DETACH event occurs?Any help is welcome.Eric
Eric, if you compiled your DLL in Visual C++ you should ask your friend whether he has VC++ or on defect its redistributable (x86) package installed, otherwise your module might work bad or not work at all.Tom

Share this post


Link to post
Share on other sites
Eric, somewhere Tim Gregson (MS/ACES) mentioned some specific options that must be used when compiling to make the .dll "Vista compliant" but I'll be darned if I can find his post now... :( IIRC, it was in a thread at http://fsdevelopers.com some months ago... :(
Bill,Is this the thread you were talking about?http://www.fsdeveloper.com/forum/showthread.php?t=12813If so, I'm sorry to say it doesn't help much...Thank you,Eric

Share this post


Link to post
Share on other sites

Yes Eric, that was the one. Darn, I had hoped it might be relevant... But, it was a long time ago so I'm just happy to have remembered that there was a post! ;)Tom may be on to something with his suggestion.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

I am using Visual Studio 2003.My friend, who has this problem under Vista, is not a developer so he doesn't have the redistributable package installed.Eric

Share this post


Link to post
Share on other sites

No immediate idea what the problem could be, but a few things to look into:

  • Are you using any OS or 3rd Party subsystems from your DLL (like MSXML, MSHTML, any COM based interfaces, OS memory allocate/free functions, etc) - if so, does your Vista using friend have a different build/version of any of these?
  • Vista may be more active in checks made at exit, so check that you have freed any memory allocated, released any COM interfaces, etc before exiting the DLL
  • Can you get physical access to the Vista machine (ie is your friend local to you), or can your friend follow directions over the phone :-> - try running FS9, with your DLL, under a debugger and see if the debugger can let you see anything useful at crash time.
  • Try creating a minimal DLL (use your same basic framework, just remove all the code that actually does something) and have your friend try that one out and see if you still get the same problem (lets you narrow it down between either how your DLL is being built (which could include the VS2003 you are using, may have to upgrade to VS2005 or VS2008) or what your DLL is doing).

Can't think of anything else right now, its been ages since I've used the old Module system (we dropped support for that system in FSX, except a small subset thats still used by gauges), but you would think having written the original version for FS95 I would remember more about it :->Tim

Share this post


Link to post
Share on other sites
No immediate idea what the problem could be, but a few things to look into:
  • Are you using any OS or 3rd Party subsystems from your DLL (like MSXML, MSHTML, any COM based interfaces, OS memory allocate/free functions, etc) - if so, does your Vista using friend have a different build/version of any of these?
  • Vista may be more active in checks made at exit, so check that you have freed any memory allocated, released any COM interfaces, etc before exiting the DLL
  • Can you get physical access to the Vista machine (ie is your friend local to you), or can your friend follow directions over the phone :-> - try running FS9, with your DLL, under a debugger and see if the debugger can let you see anything useful at crash time.
  • Try creating a minimal DLL (use your same basic framework, just remove all the code that actually does something) and have your friend try that one out and see if you still get the same problem (lets you narrow it down between either how your DLL is being built (which could include the VS2003 you are using, may have to upgrade to VS2005 or VS2008) or what your DLL is doing).

Can't think of anything else right now, its been ages since I've used the old Module system (we dropped support for that system in FSX, except a small subset thats still used by gauges), but you would think having written the original version for FS95 I would remember more about it :->Tim

Hello Tim,
  • I am not using any 3rd party subsystem, no memory allocation/deallocation. I don't even use real C++ in this module, there is no class instanciation, no new, no delete
  • Indeed, it seems that Vista makes more checks than XP. I'm not sure, but I think Vista causes a crash if it releases a space memory that has already been released. Do you know if this is correct?
  • Unfortunately my friend is not really close, and not a developper. If I can't fix the problem, I will have to install Vista on a separate partition to test it by myself.
  • The idea of creating a minimal DLL is very good. This is my next step.

Apart from this, I may have found the solution. I moved the code that closes from the DllMain (when DLL_PROCESS_DETACH occurs) to the module_deinit. It seems to work better but it needs more testing.Thanks for your great help anyway !!Eric

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...