• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Displaying a property sheet

Messages
45
Country
france
Hello,

I have a DLL which loads along with FSX, and the user can get info from my DLL through the add-on menu which launch a simple windows dialog box containing the information.

Now I want to make something more sophisticated with propertysheet and propertypages, so I have followed the standard procedure (creating property pages, loading them in the sheet with AddPage(&MyPageN) ). When I call my property sheet from within my DLL with :

CMyDialog dlg; // This is my property sheet class
dlg.DoModal()

I get an assertion failure in afxwin1.inl :
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceHandle != NULL);
return afxCurrentResourceHandle; }

Is there something special when using that kind of dialog from within a simconnect DLL ??

In particular, is there somepoint I missed with the parent window ?

Oliver
 
Hello again,

I forgot to tell : before trying to display my property sheet, I have switched to dialog mode in FSX with simconnect.

The kind of thing I want is the dialog you get with FSUIPC, with the different tabs.

Oliver
 
Me again,

I'm making my own thread by myself:)
I have changed the propety sheet for a basic dialog with two buttons that does no more than the windows Message Box, and I have exactly the same problem.
1 - I switch FS to dialog mode
2 - I try to display some UI element. Property sheets or Visual studio made dialog fails, while standard message Box works perfectly.

Any idea ?
 
Come on,

tell me if I'm probably doing something stupid, or if there's a known limitation with windows dialogs in FSX dialog mode.

oliver
 
There are lots of known limitations with doing GDI based UI from within the FS environment, which is why we don't suggest doing it :-> But, if you are going to try it, some things to try:

Make sure you have set the parent of your dialog window to be the main FS window (do a FindWindow on FS98MAIN) - if you don't do this, then your window will be under FS (especially in full screen mode). If you can live with your window only being visible in windowed mode, you can also make it a top-level window (so it shows up on the task bar display) - although if you can live with this, you could probably just make the client be an external EXE based app instead and avoid the issue altogether :->

Set FS into Dialog Mode (sounds like you are already handling this part) - the reason for this is that occasionally GDI and DirectX don't play nice together causing anomilies in the DirectX display, so in Dialog Mode, we black out the 3D windows so if there are any anomolies, they aren't visible :->

Another thing to try, use standard WIN32 API calls to create/display your dialog intead of using MFC (since FS also uses MFC internally, its possible MFC is in a weird state).
 
Problem Solved :

Another thing to try, use standard WIN32 API calls to create/display your dialog intead of using MFC (since FS also uses MFC internally, its possible MFC is in a weird state).

You can use MFC dialog in FSX dialog mode.
The problem was to manage the MFC internal state. I included a :
AFX_MANAGE_STATE(AfxGetStaticModuleState());
macro a the beginning of my dispatch callback function and that did it !

best regards

Oliver
 
Back
Top