Version 16
August, 2008

Instructions for using the WriteLog contest module creation wizard.

1. (One time only)
Unpack the zip file using "use folder names" and
customize the file include\wlversio.h file to control your copyright info and version numbers.

2. (One time only)
You must put the file WLogWz2.awx in your VC++ extension directory. For VC version 5
that is ...\SharedIDE\Template. This wizard works for VC6 as well, but you put the awx file in its ...\Common\MSDev98\Template directory

3. The following instructions and the wizard generate a project that assumes the following
directory structure:

\include
\wlogtool
\writelog
\writelog\mmdcom
\writelog\create-new-projects-here

4. In DevStudio, do a "File New Project", find the "WLogWz2 AppWizard" selection and
highlight it. Remember to choose a target directory per (3) above!

5. In the dialog that follows, here are some hints:

a. Class Name is the name of the main C++ class the wizard will generate.
b. Contest Name is what the user will see in the WriteLog Select Contest list.
c. Just put a zero in the CLSID GUID selector. Create a fresh GUID and and
edit the H file later (see step 11 below).
d. DXCC means the contest counts DXCC countries as multipliers
e. Zones means the contest counts zones as multipliers. The wizard generates
support for zones 1 - 40 (per CQ zones) but you can easily change this to
be any range of integers you want.
f. "Mults as you go" means that every unique string logged for a field is
a separate multiplier, but you don't know when the contest starts what
they're going to be. This can be used for logging those contests where the
"headquarters stations" are their own multipliers.
g. "Named Mults" means there is a list of strings (like state names, or whatever)
that are the multipliers for the contest. You will need to create (and distribute)
an INI file that has the multipliers in it along with any ALIAS names you want
to all refer to the same multiplier
h. "Multi Mode Contest" instructs the wizard to generate code for the band
summary that puts each mode in its own column.
i. "Serial Numbers" instructs the wizard to add an NR column to the log
and to put the sent/received serial numbers in the Cabrillo format.
j. "Support ScoreInfo" makes the wizard add support for enabling
WriteLog to compute the "multiplier is worth xx minutes" display.
Any contest with a final score = (total mults) * (total points) 
can do this.

6. The project that results does NOT build cleanly. (Sorry about that :-()
The following steps tell you what you have to fix.


7. The #error looks like this. And here's the right answer:

//#error "make the missing POS be (X_POS + X_WID) where X is line above"

#define RS_POS	0							//TODO	
#define SN_POS		(RS_POS + RS_WID)
#define COUNTRY_POS		(SN_POS + SN_WID)	//todo
#define AMBF_POS (COUNTRY_POS + COUNTRY_WID)
#define CPRF_POS (AMBF_POS + AMBF_WID)
#define CMULT_POS (CPRF_POS + CPRF_WID)
#define ZN_POS		(CMULT_POS + CMULT_WID)	//TODO
#define ZMULT_POS (ZN_POS + ZN_WID)

8. Edit the header file containing this:

DEFINE_GUID(CLSID_WizTestMmd, 0x0, 0x7716, 0x101A,
    0xAA, 0x54, 0x00, 0x60, 0x8C, 0x61, 0xD0, 0xB1);
/* 0-7716-101A-AA54-00608C61D0B1 */

And run the VC++ GUID generator and put in your own GUID.
There is only one place to enter the GUID and this is
it. If you're not familiar with COM GUID's then, find
the program GUIDGEN in the VC++ bin directory and run it.

9. Your DLL will not LINK yet. To make it link, Do a View
Workspace, select the FileView tab, and right click on the
"Source Files" tab, select "Add Files to Folder", navigate
up two directories, and down into the WLOGTOOL directory.
Then select BOTH of the LIB files you find there (wlogsh32.lib
and dxpref32.lib)


10. Now your DLL will build. But there are a number of TODO 
statements throughout the code. Fix them up.

11. Your DLL builds with the stand DllRegisterServer entry
point. Use the VC++ "Tools Register Control" command to
make it available to WriteLog. 

12. Debugging. You will need WriteLog installed on your
machine (of course). And you will need for your PATH environment
variable to include the \ham\programs directory that WL installed.
The PATH setup is only for debugging--it is not needed by 
WL users.

13. Shipping. You should arrange for your DLL to reside in WL's
\ham\programs directory. And if you created your own INI file
(as per step 5g) you'll need that INI file installed into
the same directory. Your installer can find this directory 
by using this key which it can find in WRITELOG.INI:

[Install]
Directory=d:\ham


14. The kit comes with one example of having run the wizard and
modified the result until it builds. Here's what to look at:
a. wiztest.bmp shows the class wizard answers
b. writelog\wiztest has the build project 



WlContestWizard12.zip
Add IWlogExf3 interface

WLContestWizard10.zip
Add IWlogScoreInfo so WriteLog can computer "Multiplier value".
If you want to retrofit an existing module with this functionality,
here is what you do:
1. In {ModuleName}mm.h 
a. add these lines in the public: section:
	//IWlogScoreInfo
	HRESULT MultsAndPts(long *pMultCount, long *pPtsCount);
	HRESULT PtsForQso(QsoPtr_t q, long *pPtsCount);
b. in the protected: section, add this:
	CWlogScoreInfo<C{ModuleName}>	m_WlogScoreInfo;

2.In {ModuleName}.cpp 
a. add this line before the opening brace of the constructor:
		, m_WlogScoreInfo(this)
b. add these lines in the QueryInteface implementation:
	else if (IsEqualIID(riid, IID_IWlogScoreInfo))
		Unk = &m_WlogScoreInfo;
c. add these lines just before the {ModuleName}PersistStore implementation:

//IWlogScoreInfo
HRESULT $$MM_CLASS_NAME$$::MultsAndPts(long *pMultCount, long *pPtsCount)
{
	int i;
	//TODO--Check if score really is mults * pts here...
	// *pMultCount = total of mults in the log
	long Mults = 0;

	// *pPtsCount = total points in the log
	long Points = 0;
	for (i = 0; i < NUM_BANDS; i += 1)
	{
		Points += m_BandPoints[i];
	}
	*pPtsCount = Points;
	*pMultCount = Mults;
	return S_OK;
}

HRESULT $$MM_CLASS_NAME$$::PtsForQso(QsoPtr_t q, long *pPtsCount)
{
	*pPtsCount = PointsForQso(q);
	return S_OK;
}

WlContestWizard16.zip
Update header files to versions corresponding to WL version 10.67.

WlContestWizard15.zip
Add IWlogCabrilloOptions
Module can control ALL the Cabrillo headers now, and, now that
WriteLog can create email messages, this same interface enables
the module to customize the email address and subject line.

Add IWlogTQslQsoLocation
WriteLog supports export to the TrustedQSL format, which requires
station location information. Modules that support Rovers should
implement this interface in order to make the LOTW output correct.

The wizard does NOT generate code for the above interfaces, but
the mmdcom.h file does have an implemenation of QueryInterface
like for all the other interfaces defined in IWriteLg.h

WlContestWizard14.zip
Add IWlogMultiGridSquare. If the multiplier module implements
this interface, then WL calls it when it wants to know a grid 
square for its beam headings.

WlContestWizard13.zip
Add commentary, and IWlogExf3

WLContestWizard9.zip
Replace IWlogMultiSingleBandChangeThrottle with a new one. Any module
that supported this will have an error the next time it is compiled. 
An argument must be added to GetBandChangeLimits for new versions of
WriteLog (10.35 and beyond) to support this. No prior versions of WL
called the old version, so no compatibility issues come from this.

WLContestWizard8.zip
Add IWlogCabrillo3. Enables additional lines other than the QSO: line in
a cabrillo output.

WLContestWizard7.zip
The wizard generated code that would, under certain conditions, overflow the
space allocated for multiplier display. This can cause loss of entered QSO data.
Previously generated modules should be inspected for calls to _itoa(). They 
should be replaced with calls to the new CvtLongToAscii() function, like this:
WRONG:		         _itoa(m_DxccMults, q->var_part+CMULT_POS,  10);
RIGHT:		CvtLongToAscii(m_DxccMults, q->var_part+CMULT_POS, CMULT_WID);

WLContestWizard6.zip
Add interface for contest modules to customize ADIF format on read and write.

WLContestWizard5.zip
Initialize the countryIndex variable in QsoAdd()/QsoRem()

WLContestWizard3.zip
Add button that generates band summary support for multi-mode contests.

