SDK Question Module Type and Description

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
3
Points
18
Working on my current orbiter module, I came across an annoyance related to the module type and description. I'm referring to the category a module is placed in in the "Modules" tab and the description that appears next to it.

Following ExtMFD's example, it seems like these are the strings in a resource script that are named IDS_TYPE and IDS_INFO.

I can successfully change my module's category by modifying the resource's string table, but regardless of what I enter for IDS_INFO, it does not appear in Orbiter.

Here is the string table inside my resource file.
Code:
STRINGTABLE
BEGIN
    IDS_TYPE                "Control"
    IDS_INFO                "SIMPIT CONTROLLER:\r\n\r\n Provides a general input output structure to help\r\n\r\nin creation of a simpit"
END

and the cooresponding resource.h file
Code:
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by SimpitMain.rc
#define IDS_TYPE                        1001
#define IDS_INFO                        1002

For comparision, here are the files in ExtMFD
String Table:
Code:
STRINGTABLE
BEGIN
    IDS_TYPE                "Tools and dialogs"
    IDS_INFO                "EXTERNAL MFD:\r\n\r\nProvides support for displaying MFD (multi-functional display) instruments in separate windows.\r\n\r\nExternal MFD windows can be opened by selecting the ""External MFD"" entry in the Custom Functions dialog (Ctrl-F4)."
END
Resource.h:
Code:
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ExtMFD.rc
//
#define IDD_MFD                         101
#define IDB_PIN                         104
#define IDSTICK                         999
#define IDC_WHOAMI                      1000
#define IDC_IAM                         1001
[B]#define IDS_TYPE                        1001[/B]
#define IDC_REMEMBER                    1002
[B]#define IDS_INFO                        1002[/B]
#define IDC_DISPLAY                     1003
#define IDC_BUTTON1                     1004
#define IDC_BUTTON2                     1005
#define IDC_BUTTON3                     1006
#define IDC_BUTTON4                     1007
#define IDC_BUTTON5                     1008
#define IDC_BUTTON6                     1009
#define IDC_BUTTON7                     1010
#define IDC_BUTTON8                     1011
#define IDC_BUTTON9                     1012
#define IDC_BUTTON10                    1013
#define IDC_BUTTON11                    1014
#define IDC_BUTTON12                    1015
#define IDC_BUTTON_PWR                  1016
#define IDC_BUTTON_SEL                  1017
#define IDC_BUTTON_MNU                  1018

This puts my module into a category named "Control", but does not display the description. Also, is any of this info in the orbitersdk reference? I couldn't find anything related to this, so I'm just working off of the samples.
 
...
This puts my module into a category named "Control", but does not display the description. Also, is any of this info in the orbitersdk reference? I couldn't find anything related to this, so I'm just working off of the samples.
Strange, I do the same with several of my modules and they all show up.
What Compiler are you using?
Maybe it's just the Solution/Project that is not issuing the resource-compiler?
The "automatic solution conversion" does not always work as it should.
I've attached a module of mine containing solutions for some versions of Visual Studio, so you might compare the solution/project settings with yours.

Regards,
Kuddel
 

Attachments

Thanks, I solved the issue with the help of your code.

Orbiter apparently uses whatever string is number 1000, not what string is named IDC_INFO.
I edited my resource.h file to be
Code:
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by SimpitMain.rc
#define IDS_TYPE                        1001
#define IDS_INFO                        1000

And the description appears. I have no idea why ExtMFD works the way it is with IDC_INFO being 1002.
 
Thanks, I solved the issue with the help of your code.
Nice to hear.

Orbiter apparently uses whatever string is number 1000, not what string is named IDC_INFO.
I edited my resource.h file to be
Code:
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by SimpitMain.rc
#define IDS_TYPE                        1001
#define IDS_INFO                        1000
And the description appears. I have no idea why ExtMFD works the way it is with IDC_INFO being 1002.
Right! I should have seen that in the first place :facepalm:

For anyone who is interested:
The name of the define (here IDS_INFO)is irrelevant! You could also have named it MENSON_800_IS_THE_GREATEST ;) (and use it EVERYWHERE!)
After the preprocessor ran through the code, all that's left is the (numeric) ID (1000 in our example)
These defines are just an 'alias' so that the programmer can make sense of it; the computer doesn't care. If you search and replace all IDS_INFO by 1000 (even in the rc file) you should get the same result.
There is a kind of 'naming convention' though that defines starting with IDS_ are String resources, IDC_ are components etc. pp.

Glad that it worked out for you,
Kuddel
 
Back
Top