MSMQ on Windows Mobile 5.0
Did you know there is a new version of MSMQ for Mobile 5.0? The distribution package is available as an aditional download from here:
https://msdn.microsoft.com/mobility/windowsmobile/downloads/default.aspx
And finally its available through CF 2.0 on Windows Mobile 5.0.
Installing MSMQ requires the cab file from the redistribution download: msmq.arm.cab. Drop it on the device and run the cab to extract the driver and admin tools.
Next go and change the device name to something unique on the network (Start | Settings -> System Tab -> About ->Devic ID tab). Then go to the \windows directory and run VisAdm.exe. This provides a somewhat graphical front end to the old command line tool msmqadm.exe.
MSMQ is installed after the cab is run, but its not configured. VisAdm takes various string commands to run against the command line app. It looks a bit like this:
Click on the Shortcuts button to see a list of pre-populated commands and select:
1> Install (No output on success)
2> Register (a GUID is displayed, or if its already registered then you get a warning)
Now soft reset the device and re-run VisAdm. This time run Verify and Status to check all is working ok.
Right we are ready to write some code.
My first (and only) app simply uses a local queue to post a message and pull the same message back out of the local queue:
...
using System.Messaging;
namespace TestMSMQ
{
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
if (!MessageQueue.Exists(@".\private$\MyQueue"))
MessageQueue.Create(@".\private$\MyQueue");
}
private void button1_Click(object sender, EventArgs e)
{
MessageQueue myQueue = new MessageQueue(@".\private$\MyQueue");
myQueue.Send(this.textBox1.Text);
myQueue.Close();
}
private void button2_Click(object sender, EventArgs e)
{
MessageQueue myQueue = new MessageQueue(@".\private$\MyQueue");
((XmlMessageFormatter)myQueue.Formatter).TargetTypes = new Type[] { typeof(string) };
try
{
Message myMessage = myQueue.Receive(new TimeSpan(0));
textBox2.Text += (string)myMessage.Body + "\r\n";
}
catch (MessageQueueException mqe)
{
MessageBox.Show("No Message");
}
finally
{
myQueue.Close();
}
}
}
}
Grab the whole thing from here.
There are a couple of things worth pointing out:
1> When retrieving a message from the queue the type needs to be handed to the MessageQueue class. Only string is supported at the moment.
2> It is possible to use off device queues. To do this the queue name needs to be specified as a formal name: "FormatName:Direct=OS:MyMachine\private$\MyDesktopQueue"
3> This version of MSMQ was meant to support an HTTP transport. Unfortunately there is a bug that causes HTTP transport to fail. I believe the product team are working on this and hope to have a public fix soon. Watch this space.
Next I need to do something meaningful with MSMQ and a couple of devices… but that’s for another post.
Marcus
Comments
Anonymous
February 02, 2006
MSMQ has been available on Windows CE and Windows Mobile for a while now. It was quite interesting, but...Anonymous
February 03, 2006
Where did you get that version of visadm ? It's not in the cab file. It looks like the old 2003 version. The new version (you have to build it yourself) that comes w/ the Mobile 5 sdk doesn't look like this one. BTAIM, when I do the install on a Mobile 2005 / hx2495, no registry settings get created :-(Anonymous
February 05, 2006
The VisADM.exe is definately in the CAB file. Did you check the download from here:http://msdn.microsoft.com/mobility/windowsmobile/downloads/default.aspx
VisADM.exe is installed into the windows directory on the device.
There is also a version of this app in the SDK that looks a lot different, but you dont have to use this version. I'm not sure what the differences are beyond the look and feel.
MarcusAnonymous
February 06, 2006
Any issues with running this on a smartphone running mobile 5 apart from the obvious interface changes?Anonymous
February 06, 2006
Marcus, You're right, the CAB file does include "VISADM.EXE" and executing the CAB file puts the "VISADM.EXE" into the Windows folder which isn't where I expected it to be compared to previous CE MSMQ 'installs' ;-)
Next confusion(1): immediately after executing the CAB file (ActiveSync is running, 'clean' iPaq hx2495) and closing it's 'success' window (and I can see the files in the Windows folder), from my Win2k Pro/Sp4 PC I launch VS2005 / Remote Tools / Remote Registry Editor and I do not see HKLMSoftwareMicrosoftMSMQ key. I disconnect and restart the device a few times and like majic, the HKLMSoftwareMicrosoftMSMQ key is there, but I have not run VISADM.EXE yet. I run VS2005 / Remote Tools / Remote Process Viewer and check both device.exe and services.exe and do not see the MSMQD.DLL listed for either.
Next confusion(2): Then after running Mark Ihimoyan's CF2 CE MSMQ, relaunch VS2005 / Remote Tools / Remote Process Viewer and MSMQD.DLL is showing up under DEVICE.EXE, not SERVICES.EXE.
Again, any info is appreciated!Anonymous
February 08, 2006
John,
Not that I've seen. I ran the same sample with a slightly modified UI - buttons moved to Menu items etc. and it all worked fine.
I must admit I tend to stick with PPC when trying stuff out but only becuse its easier to get arround and there is a bit more space for my bad UI's :)
MarcusAnonymous
February 08, 2006
The comment has been removedAnonymous
February 10, 2006
TGIF!  (sort of..  I'll be working through the weekend yet again..sigh).   Oh yeah,...Anonymous
February 23, 2006
Hi, I stumbled across your blog while trying to figure out why I can't install MSMQ on a WM5 iPAQ 2490 (I'm moving our app from WM2003). Got all the recommended downloads and run VISADM. Install and register ok, soft reboot and back to VISADM. Verify looks ok but shows nothing in Application DataVolatile, status shows 'Operation failed. Error code c00e000b'. Installing the same msmq.ARM.CAB on the VS2005 Emulator works fine. I'm missing something.
Can you enlighten me?
Thanks, Martin
PS exactly the same happens on an XDA Exec.Anonymous
March 27, 2006
Hi,
I have installed as u said in your article. With the latest cab available at MS site. LINK:
http://www.microsoft.com/downloads/details.aspx?FamilyID=cdfd2bb2-fa13-4062-b8d1-4406ccddb5fd&DisplayLang=en
After Install and register, I soft-reboot my device (Treo 700W) and then verified as u said. Its shows...
Computer name "Treo"
MSMQ daemon intalled.
NETREG daemon intalled.
MSMQ configured.
Default Quota:256
Port:1801
Ping Port:3527......
..........
....................
...
BUT when I click on Status button given in VisAdm, it shows following error "Operation failed. Error Code c00e000b".
After running my test application it gives error "Message Queue Service is not available."
Can u suggest what /where I missed out?
Thanks in your anticipation,
Rakesh Ranjan,
Iselin, NJ, USA.Anonymous
April 25, 2006
Hi , you should do like this :)
http://blogs.msdn.com/ihimmar/archive/2004/06/14/154911.aspx
the necessary step in PocketPC:
IntPtr handle = ActivateDevice(@"DriversBuiltInMSMQD", 0);
CloseHandle(handle);Anonymous
June 01, 2006
Hi!
has anyone ever tried this on the Emulator in VisualStudio 2005? (Installation in Workgroup mode -> only private queues)
Installing works, local queue send&recieve (on both Em.&PC) too, but to the machine that runs the Emulator and back - no connection available. TCP/IP Works, can ping the Emulator, but not send to remote queue either from Em.>PC nor PC>Em.!
All diffrent namings tried(to create MessageQueue object)FormatName:DIRECT=OS:MachineNamePrivate$QueueName ,FormatName:DIRECT=TCP:IPAddressPrivate$QueueName,MachineNamePrivate$QueueName).
on PDA I get "the queue does not exist or you do not have sufficient permissions to perform the operation"
on PC I can create MessageQueue object with direct:TCP... but all attributes of it show:
"The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted."
System.Runtime.InteropServices.ExternalException {System.Messaging.MessageQueueException}
sending messages succeeds but on PDA nothing arrives.
Intranet in company, all ports open, no router/firewall.
What could be wrong??
Thanks a lot for any help!
Max, SingaporeAnonymous
June 12, 2006
Hi Marcus,
Thanks for the details provided in your blog.
It's been very helpful.
I have downloaded and installed MSMQ from
the URL you have provided (http://msdn.microsoft.com/mobility/windowsmobile/downloads/default.aspx)
and managed to install it on Windows mobile 5.0
Smartphone and run a sample C++ application
calling the functions defined in
mq.h successfully.
I was wondering if you know where I could find
the header, libs and dlls that define the
MSMQ COM interfaces (Mqoai.h, Mqoa.lib)?
Mqoai.h/Mqoa.lib which are referenced in
MSMQ msdn documentation e.g. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemsmq/html/cerefmsmqmessage.asp.
Thanks,
-- zhamakAnonymous
August 02, 2006
Same problem here on running VISADM - error code c00e000b. Several people here have posted this problem, but no-one has given a fix, unless I'm misreading the thread!!Anonymous
August 22, 2006
This has helped a ton... Took me forever to figure it out, but has it ever helped... Wondering if you have done anything with sending a message from a mobile device to a server running windows 2003 IIS with MSMQ on the server... or if someone knows of a cool link... I am thinking I could use TCP/IP...
The mobile device will be craddled during the operation for now...Anonymous
September 11, 2006
I have the same error code c00e000b on my Dell Axin x51, HP iPaq 2490B, HP iPaq Rx 1950 ( All Windows Mobile 5.0 ). When I try to send a Message to a Windows XP queue and my iPaq is connected to activeSync it sends the message. When I try to send throught Wi-Fi it doesn't work. I can ping both machines but I can't send the message. I will check with my new HP iPaq HW 6940Anonymous
October 16, 2006
Like David Say, still we don´t have a fix or workaround to solve the problem of MSMQ on Windows Mobile 5. VISADM - error code c00e000b I tryed with ActiveDevice even with Mark Ihimoyan´s sample: http://blogs.msdn.com/ihimmar/archive/2004/06/14/154911.aspx And the behaivor is the same. I'm using a Symbol MC7090 with Windows Mobile 5.0 (OS 5.1.70)Anonymous
October 17, 2006
http://blogs.msdn.com/ihimmar/archive/2004/06/14/154911.aspx http://blogs.msdn.com/marcpe/archive/2006/02/01/522112.aspxAnonymous
October 17, 2006
http://blogs.msdn.com/ihimmar/archive/2004/06/14/154911.aspxhttp://blogs.msdn.com/marcpe/archive/2006/02/01/522112.aspxBuen...Anonymous
November 06, 2006
Hi! has anyone ever tried this on the Emulator in VisualStudio 2005? (Installation in Workgroup mode -> only private queues) Installing works, local queue send&recieve (on both Em.&PC) too, but to the machine that runs the Emulator and back - no connection available. TCP/IP Works, can ping the Emulator, but not send to remote queue either from Em.>PC nor PC>Em.! All diffrent namings tried(to create MessageQueue object)FormatName:DIRECT=OS:MachineNamePrivate$QueueName ,FormatName:DIRECT=TCP:IPAddressPrivate$QueueName,MachineNamePrivate$QueueName). on PDA I get "the queue does not exist or you do not have sufficient permissions to perform the operation" on PC I can create MessageQueue object with direct:TCP... but all attributes of it show: "The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted." System.Runtime.InteropServices.ExternalException {System.Messaging.MessageQueueException} sending messages succeeds but on PDA nothing arrives. Intranet in company, all ports open, no router/firewall. What could be wrong?? Thanks a lot for any help! arvind,new delhiAnonymous
November 13, 2006
it setup runs correctly on pocket pc -windows mobile 5.0 bit in status option shows MSMQ_CE DISCONNECTED because of we are not able to send message to from device to desktop plz suggestAnonymous
November 14, 2006
Llevo un par de dias urgando en la versión de MSMQ para dispositivos móviles preparando una maravillosaAnonymous
November 15, 2006
The ActiveDevice method cannot run in User Mode, exec this code in WindowsStartUp and soft reset. Best regards, Unai Zorrilla Castro, MVP Compact FrameworkAnonymous
November 29, 2006
Norzagaray, I had the same problem with an i-Mate K-JAM. Creating a console application which did the following solved it immediately: int _tmain(int argc, _TCHAR* argv[]) { // Based on http://www.developersdex.com/vb/message.asp?p=2916&r=4819100&page=2 HANDLE handle = ActivateDevice(L"Drivers\BuiltIn\MSMQD",0); HRESULT hr = GetLastError(); if (handle!=NULL) { CloseHandle(handle); } wchar_t resultString[2000]; wsprintf(resultString, L"The call to ActivateDevice returned %x.", hr); MessageBoxW(NULL, resultString, L"MSMQ Activation", MB_ICONINFORMATION); return 0; } On the emulator I got HRESULT=5 for an unsigned exe and HRESULT=924 for a signed exe (which I assume signified that MSMQ is already running). On the K-JAM I got HRESULT=0 and MSMQ started working. Hope this helps you too.Anonymous
November 29, 2006
Norzagaray, I had the same problem with an i-Mate K-JAM. Creating a console application which did the following solved it immediately: int _tmain(int argc, _TCHAR* argv[]) { // Based on http://www.developersdex.com/vb/message.asp?p=2916&r=4819100&page=2 HANDLE handle = ActivateDevice(L"Drivers\BuiltIn\MSMQD",0); HRESULT hr = GetLastError(); if (handle!=NULL) { CloseHandle(handle); } wchar_t resultString[2000]; wsprintf(resultString, L"The call to ActivateDevice returned %x.", hr); MessageBoxW(NULL, resultString, L"MSMQ Activation", MB_ICONINFORMATION); return 0; } On the emulator I got HRESULT=5 for an unsigned exe and HRESULT=924 for a signed exe (which I assume signified that MSMQ is already running). On the K-JAM I got HRESULT=0 and MSMQ started working. Hope this helps you too.Anonymous
December 13, 2006
Hi. Do you know if the problem with MSMQ using HTTP has been resolved in Windows Mobile 5? Ian.Anonymous
December 13, 2006
Hi. Has there been a fix supplied yet for using HTTP queues in MSMQ on Windows Mobile 5? Ian.Anonymous
February 23, 2007
Hello i have tried to run MSMQ on processor ARM920T PXA27x (device model Unitech PA600) and also on processor Samsung 2442A (device model SPV M3100) and didnt work. Same error like the others "c00e000b", no ideas why. I also used a pert of code to make "device activation" but it didnt work either. Is there someone who resolve the problem ?? Or know where the problem is ??, it is depend on processor type ??Anonymous
February 23, 2007
The comment has been removedAnonymous
March 02, 2007
I need to start investigating this technology as more and more of my customers are starting to introduceAnonymous
May 09, 2007
Can anyone document the units for the 'MSMQSimpleClientRetrySchedule' registry setting???Anonymous
May 10, 2007
Marcus, Can you share anything about using MSMQ with Windows CE in a dual homed scenario, ex. a device messaging with a server via both WiFi and GPRS?Anonymous
July 18, 2007
The comment has been removedAnonymous
September 25, 2007
Hello, I have I-mate Smartphone, with operation system: windows mobile 5. I’m trying for quite to install MSMQ, as following: http://msdn2.microsoft.com/en-us/library/aa450030.aspx
- run MSMQ cab
- run visadm.exe -> run install -> run registry
- Soft reset
- run visadm.exe -> status
- get error I tried every thing, checked the forums but all say the same process. I need help, and it is urgent. Any one has any idea? Thanks :)
Anonymous
February 12, 2008
Well, Steve is off to a blazing start this month and I have to admit there is a lot of news and rumorsAnonymous
February 12, 2008
Well, Steve is off to a blazing start this month and I have to admit there is a lot of news and rumorsAnonymous
February 25, 2008
I also have no success in getting MSMQ running on WM 6.0. I consistently get error c00e000b. I have tried signing cab, shutting off security to the device via VS2008, upgrading CM to sp2, and everything else I can think of. This was not a problem on PPC2003 but these devices are no longer available. This is a major problem for me. Any suggestions?Anonymous
January 21, 2009
PingBack from http://www.keyongtech.com/1798678-msmq-with-windows-mobile-2005-a