How to use the ImsEnc control in Visual C:

 1. Create a new project ('File', 'New', 'MFC AppWizard(exe)').
 2. In step 1 of the AppWizard select "Dialog based".
    Other selections of the AppWizard are OK.
 3. Select 'Project', 'Add To Project', 'Components and Controls'.
    The 'Components and Controls Gallery' appears.
 4. Double-click the 'Registered ActiveX Controls' entry.
    The available ActiveX controls are displayed.
 5. Select the 'ImsEnc Control', and click the 'Insert' button.
    Answer OK to 'Insert this component?'.
    Answer OK in the 'Confirm Classes' box.
 6. Close the 'Components and Controls Gallery'.
 7. Enter the dialog (double-click the second item of
    ResourceView, Dialog).
 8. If the dialog editor's toolbox (titled Controls) is not
    visible, right-click the mouse on a free space in the dialog
    and check the 'Controls' entry.
    In the dialog editor's toolbox there should be a new control,
    labeled ENC. Create in the dialog a new object of the 'ENC'
    control. This object will be invisible at run time.
 9. Enter the Classwizard (View, ClassWizard).
10. Select the 'Member Variables' tab.
11. Double-click on 'IDC_IMSENCCTRL1', and specify the 'Member
    variable name', as, say, 'm_ImsEnc'. Click OK, OK.
    The control is now available.
12. In order to make control's symbolic constants (such as LedRed)
    available:
    * Copy the "EncConst.h" file to your Visual C project folder.
    * Add that file to the project ('Project', 'Add To Project',
      'Files', 'EncConst.h').
    * In dialog's header file (...Dlg.h) there's an
      '#include "imsenc.h"' statement that was added by the
      Classwizard.
      Follow this line with an '#include "EncConst.h"' statement.
13. In the file ...Dlg.cpp you'll find the OnInitDialog routine.
    After the line -
	// TODO: Add extra initialization here
    - add the following line:
	m_ImsEnc.SetActive(1); // Make the control active.
    During run-time, this function makes the control active,
    i.e., all its functions become available.
14. To try the control:
    * Add a new button.
    * Edit its OnButton routine by the following sequence:
      * Double-click the new button
      * Double-click BN_CLICKED
      * Click OK
      * Click 'Edit Existing'
    * Add to the OnButton routine the following code:
	// Flash the LEDs:
	int CardNumber = 6 ;// Corresponds to default Address Base
	// selection. Please refer to section 2.2.2 in the manual.
	for (int i=1 ; i<=10 ; i++ ) {
		m_ImsEnc.SetLed(CardNumber,LedYellow,TurnOff);
		m_ImsEnc.SetLed(CardNumber,LedRed,TurnOn);
		Sleep(100);
		m_ImsEnc.SetLed(CardNumber,LedYellow,TurnOn);
		m_ImsEnc.SetLed(CardNumber,LedRed,TurnOff);
		Sleep(100);
	}
    Pressing the new button should flash card's two LEDs,
    indicating that your 'ImsEnc Control' functions properly.


Note
----
The folder EncBasicTest includes a sample basic project that was
created according to the instructions above. The output files
generated by Visual C builder are directed to the folder Debug,
but are not supplied, as these are big files and may be reproduced
easily by the user running 'Rebuild All'. Though, the main output
file (EncBasicTest.exe) is supplied in the 'EncBasicTest' folfer.
It was not put in the Debug folder to avoid conflict when the user
runs 'Rebuild All'.
