Installation

< BACK  NEXT >
[oR]

Installation of MSMQ on Windows CE and desktop computers is probably more difficult than actually writing code to send and receive messages. Part of the difficulty is that MSMQ on Windows NT and Windows 2000 has an enterprise installation that configures one or more MSMQ sites. The following computers are generally used:

  • A PEC (Primary Enterprise Controller), which must be installed on a Windows NT or 2000 Server installation. This computer must also run Microsoft SQL Server on Windows NT. This machine manages the MSMQ Information Store (MSMQI) used to locate message queues on other computers.

  • Optional BSCs (Backup Site Controllers). These maintain backups of the MSMQI for fault tolerance purposes.

  • Additional PSC (Primary Site Controllers) for managing other sites.

  • Optional MSMQ Routing Servers to route messages between sites.

Other computers on the network can be independent clients (which can manage their own queues) or dependent clients (which can only access queues on other computers). All in all, setting up and managing a MSMQ installation is a job for a network administrator rather than a programmer. Most of us want to write applications using MSMQ rather than spend our time setting up numerous computers.

Windows 2000 Workstation can make this all much easier for the developer, since Windows 2000 Workstation allows a "workgroup" installation of MSMQ. This does not involve installing a PEC, MSC, or PSC. However, it does have two limitations:

  • You cannot use public queues, only private ones.

  • You must address a queue directly using its DNS (computer) name.

Given that Windows CE can only use private queues, this does not affect Windows CE MSMQ development. From personal experience, installing Windows 2000 just for MSMQ development is quicker than trying to set up a MSMQ enterprise.

Installing MSMQ on Windows CE

First, before installing MSMQ on Windows CE, you will need to change the computer name from the default the Windows CE device was shipped with (for example, Pocket_PC). This is to ensure that no two Windows CE devices use the same machine name for naming MSMQ queues. The name is stored in the registry in the key HKEY_LOCAL_MACHINE\Ident\Name. The original name of the device is stored in HKEY_LOCAL_MACHINE\Ident\OrigName.

Since MSMQ is not part of the standard Windows CE operating system, it needs to be installed separately for many devices, such as Pocket PC. You can do this as part of your application's installation process. In all installations, the following files need to be copied into \windows:

  • MSMQD.DLL Main MSMQ engine implemented as a device driver

  • MSMQRT.DLL MSMQ run-time component that implements MSMQ API

  • MSMQADM.EXE MSMQ administration and configuration tool

If your Windows CE device does not have a statically assigned IP address, you will also need to copy NETREGD.DLL into \windows. This library will register the assigned IP address and computer name with WINS (Windows Internet Naming Service). MSMQ only uses DNS (computer) names, not IP address, to reference queues. Therefore, the Windows CE device must have access to a WINS server unless the device has a statically assigned IP address. In addition, it must also have the following:

  • Access to DNS supporting reverse lookup (that is, a DNS server that can convert an IP address to a DNS name)

  • Or relevant DNS entries in the LMHOSTS file on the Windows 2000 computer and in the HKEY_LOCAL_MACHINE\Comm\TCPIP\Hosts registry key on the Windows CE device

Configuring DNS and IP addresses is covered later in this section. For initial development of MSMQ applications, I recommend that you use a statically assigned IP address on your Windows CE device and add LMHOST registry entries to specify the IP address and names of the computers on which you are using queues. You will also need to add registry entries to enable MSMQ on the device. There are three ways of doing this:

  • Using VISADM.EXE. This utility can be copied into the directory \ProgramFiles\MSMQ. To install MSMQ using this utility, run VISADM, click the Shortcuts button, and click "Install." You will then need to reboot the Windows CE device.

  • Using MSMQADM. This technique would generally be used as part of your own application's installation. This application is run a number of times with various command line arguments to configure MSMQ. The section "Installing MSMQ Using MSMQADM.EXE" in the on-line help describes this.

  • Writing registry entries. This technique would be used as part of your own application's installation process and where you need to change the default installation provided by MSMQADM. The section "Installing MSMQ Manually" in the on-line help describes the registry entries and their meanings.

The tool VISADM.EXE can be used to verify the installation. Run VISADM.EXE, click "Shortcuts," and click "Verify." This verifies that the installation is complete and lists the registry entries.

Installing MSMQ on Windows 2000

MSMQ is not part of the standard Windows 2000 installation. To install MSMQ, you will need to do the following:

  • Run the Control Panel (Start menu, Settings, and Control Panel)

  • Select "Add/Remove" Programs

  • Click "Add/Remove Windows Components"

  • Select "Message Queuing Services" from the Component list and click "Next"

  • Follow through the Wizard steps

You can verify the installation using the Computer Manager application described in the next section.

Managing DNS Entries

MSMQ does not allow a computer to be referenced by IP address; you must use a computer name. For this reason DNS with reverse lookup or WINS must be available. If this is not the case (perhaps your computer is not connected to a network), you can specify entries in the Windows CE registry or in the LMHOSTS file on Windows 2000 to create the mapping.

On Windows CE you will need to place entries in the key HKEY_LOCAL_MACHINE\Comm\tcpip\hosts for each Windows 2000 computer that you want to access an MSMQ queue on. You should create a key with the name of the Windows 2000 computer, and this key will have a value with the name "ipaddr" containing the IP address. For example, if your Windows CE device needs to access a queue on a Windows 2000 computer called "nickdell", you will need to add the following registry keys and values to the registry on the Windows CE device:

 HKEY_LOCAL_MACHINE   Comm     Tcpip       hosts         nickdell           (default)    (not set)           ipaddr       C0 A8 37 64 

You can see from this example that the IP address is stored as a 4-byte binary value rather than a string. The binary value "C0 A8 37 64" represents the IP address "192.168.55.100". The Windows CE device will need to be reset before new entries will be recognized.

If your Windows 2000 computer needs to access a queue on a Windows CE device, you will need to ensure that the Windows 2000 computer can access the Windows CE device by name (for example, "ncg_ppc") rather than IP address. First, you can check whether the Windows CE device has registered itself using NETREGD.DLL with an available WINS or DNS server. The following steps are required:

  • Run CMD.EXE on the Windows 2000 machine.

  • Type the following, replacing "ncg_ppc" with the name of your Windows CE machine:

     ping ncg_ppc 

If you get a message that the host is unreachable, you will need to update the LMHOSTS file on your Windows 2000 machine. This file is located, by default, in the directory \WinNT\system32\drivers\etc. Open LMHOSTS and add a line like the following at the end:

 192.168.0.124 NCG_PPC #PRE 

In this case "192.168.0.124" is the fixed IP address for the Windows CE device, and NCG_PPC is the Windows CE device name. You may need to restart Windows 2000 for this change to take effect.

IP Network, RAS, and ActiveSync

MSMQ requires a full IP connection between the Windows CE device and Windows NT or 2000 server to which it is connected. If you use a serial connection between a Windows CE device and desktop PC, and connect using ActiveSync, you may not be able to connect to MSMQ queues on other computers. This is because ActiveSync does not implement a true TCP/IP connection. The problem is that many developers use an ActiveSync connection for downloading onto the device the applications they are building, and this may stop MSMQ from working.

One way around this is to configure ActiveSync to accept Network connections rather than a connection through a COM port. Then, you can configure your desktop machine to accept inbound RAS connections through the COM port. Your Windows CE device can connect using RAS (which provides a full TCP/IP connection to your network), and then the device can connect to ActiveSync through this TCIP/IP network connection.


< BACK  NEXT >


Windows CE 3. 0 Application Programming
Windows CE 3.0: Application Programming (Prentice Hall Series on Microsoft Technologies)
ISBN: 0130255920
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net