Sign in to follow this  
Rocky

Modules in FSX

Recommended Posts

HiIm trying to update a FS module i wrote in C++ for FS9, to work with FSX. What do i need to do to get it to work in FSX. I understand that i must add the dll to the dll.xml, right? Well, it seems that FSX loads the DLL without problems. FSX asks me when i start if i wanna load the dll, because it is not signed or something. How do i get FSX to load it without this notice?And, when FSX starts, i try to add my own menu, however, the menu won't draw in fsx. In FS9 i draw the menu like this. How should it be updated?#define MENU_ENTRY "System"LRESULT CALLBACK CallWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){switch (uMsg) {case WM_NCPAINT:{HMENU TestM;TestM = GetMenu(hwnd);if (TestM != NULL) {int i;for (i = 0; i < GetMenuItemCount(TestM); i++){char buf[128];GetMenuString(TestM, i, buf, 128, MF_BYPOSITION);if (strcmp(buf, MENU_ENTRY) == 0){break;}}if (i < GetMenuItemCount(TestM)){break;} HMENU SubMenu; HMENU MyMenu; SubMenu = GetMenu(hwnd); MyMenu = CreatePopupMenu(); AppendMenu(MyMenu, MF_STRING, 4236, "Start System"); AppendMenu(SubMenu, MF_STRING | MF_POPUP, (UINT)MyMenu,MENU_ENTRY);}}}return CallWindowProc((FARPROC)oldWndProc, hwnd, uMsg, wParam, lParam);}And the function is hooked in the module_init() function:oldWndProc = (WNDPROC)SetWindowLong(hFSimWindow, GWL_WNDPROC, (LONG)CallWndProc);At last, are there anything else i should be aware of when upgrading my module to work with FSX?Thanks for your help!Regards,Rasmus Steffensen

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You have to use SimConnect in FSX to add menu entries.

Share this post


Link to post
Share on other sites

If you don't want to have the module load notice, you must digitally sign it with a certificate, just like it works for the DLL gauges in FSX.And you can't have a menu added in FSX as you did for fs9. FSX doesn't use standard Windows menu like fs9 did, you now have to do it with SimConnect.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