WriteLog contest module development – Part 5: Supporting Structures

A couple of easy but important changes need to be done to this structure in SKCCWESmm.h. Leave the MAXIMUM_BANDS constant alone. We will return to the very important CONFIG_LENGTH constant defined here due to its use in other parts of the module. Defing MAX_NAMED_MULTS to match the number of mults named in the module’s INI file, SKCCWES.INI. MAXAYG defines the maximum number of as-you-go multipliers are available. For an SKCC contest, it isn’t likely an op will work all the members but it doesn’t hurt to make sure the list is big enough. AYGSTRING_WIDTH needs to be large enough to hold a member’s SKCC number, including the honorary C or T.

enum { MAXIMUM_BANDS = 42,
CONFIG_LENGTH = 14, // must match the number in SKCCWESdat.cpp
MAX_NAMED_MULTS = 292, // matches number of mults in SKCCWES.INI
MAXAYG = 6000, // exceeds current SKCC member count
AYGSTRING_WIDTH = 6, //SKCC Number of 4 digits plus C or T plus null char
};

Now set up the INI file for the contest. Edit the Init() method of the main class; I called the file SKCC_WES.INI. I created the INI file by copying the United Nations three letter codes for areas and countries into the INI file. Delete USA and CAN, and changed the lines to break them into alphabetic groupings like: “=A” and “=B” and so on. I copied the North America multipliers from namedmul.ini, taking only the two NAS sections. I renamed the sections to [SKCC_WES] and [SKCC_WES-ALIAS]. The details are in the contest wizard read-me file. I changed the MAX_NAMED_MULTS to 292 in SKCC_WESMm.h to correspond to the number of multipliers I ended up with in the INI file. This INI file needs to go into the WriteLog programs folder with the rest of the contest modules and their INI files. Download the INI file I created and have a look.

The secret to displaying fixed columns with titles in the Multiplier Display.

I saw this question when searching the WriteLog email reflector for clues about contest module development. The contest multiplier display shows the multipliers you have chosen for the contest in a dialog box. The combinations include DXCC, zones, as-you-go multipliers, and named multipliers. DXCC multipliers are set using the almost universal country DAT files that you download. Zones are defined right in the contest module code as a fixed array. As-you-go multipliers aren’t defined before the contest, and named multipliers are created in an INI file that you create. Look at the INI files for other contest modules. Multipliers are defined by their name=column title combination. The column title is tricky to display in the dialog box. The secret is in the Display() method of the main class which calls a method like this:

m_MultDispContainer->MakeDisplay(1, 0,
IID_IMultDisplayPage,
(IUnknown **)&m_NamedDisplay);

There are two mystery number parameters in the MakeDisplay() method. The first one is a flag that sets whether the display handles multiple bands. The second parameter is always 0 in generated code. This flag tells WL to create fixed sized columns with headers. Set the second parameter to 1 and your named multipliers will show up in separate columns with the title over each column. The trick is easy once you see it. Unfortunately, the SKCC multiplier list does not really lend itself to fixed columns because there are so many named multipliers (at least the way I wrote it).

While you are editing SKCCWESMm.h, go ahead and add four properties to the class to save the op’s SKCC number, Bonus, Centurion count, and Tribune count.

char m_MySKCC[6];
int m_MyBonus;
int m_MyCents;
int m_MyTribs;

Remember to initialize these in the class constructor later. We’ll be using these to calculate the score for the summary and reports.

At this point, be sure to try your module out. If you haven’t already, do Tools| Register control in Visual Studio and hit F5 to launch the debugger. Start a new contest, scroll down, and SKCC Weekend Sprint shows up in the list.

The exchange input box has the fields in it and you can log Qs at this point but the score calculation is still wrong.

There were some big rocks to climb here. Download the INI file I created for this project to save yourself some work. I’ve covered a lot of ground here and it seems the context of the examples is getting lost. So download the source code that I have so far and have a look. This is actually a working module and I used it in last weekend’s SKCC WES. It worked like a charm. Don’t know if I would trust my programming on a major contest but all of those events have pretty much been written and vetted already.

SKCC WES Contest Module as of 2006-06-15

WriteLog is Copyright © 1992-2009 by Wayne E. Wright, W5XD.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

Leave a Reply