From: Bob Hanson on
Hello All,

I am getting errors on the MessageQueue.Create statement of:

public static class CommonTools
{
// Since this is a private queue we follow the naming convention
// MachineName\Private$\QPath
// "." represents the local machine name
public const string QPath = @".\Private$\msmqdemo";
public static MessageQueue mesSendQ = null;
public static MessageQueue mesReceiveQ = null;

public static string CreateQueue()
{
try
{
mesSendQ = MessageQueue.Create(QPath); << Error occurs here
return "CreateQueue Successful";
}
catch(Exception ex)
{
return ex.Message;
}
}

This is the stacktrace that I get:

at
> System.Messaging.Interop.SafeNativeMethods.MQPathNameToFormatName()\r\nat
> System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath()\r\nat
> System.Messaging.MessageQueue.get_FormatName()\r\nat
> System.Messaging.MessageQueue.SendInternal()\r\nat
> System.Messaging.MessageQueue.Send()\r\nat
> DemoMSMQ.Forms.testForm.buttonSend_Click()\r\nat
> System.Windows.Forms.Control.OnClick()\r\nat
> System.Windows.Forms.Button.OnClick()\r\nat
> System.Windows.Forms.ButtonBase.WnProc()\r\nat
> System.Windows.Forms.Control._InternalWnProc()\r\nat
> Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat
> System.Windows.Forms.Application.Run()\r\nat
> DemoMSMQ.Forms.Program.Main()\r\n

I tested this same code on the desktop and it worked fine. Is there a
problem with my queue path syntax for cf 2.0?

Thanks in advance for your help :)

--
Bob Hanson
Senior Solutions Developer

From: Ilya Tumanov [MS] on
This path should work.



By the way, your stack trace indicates exception happens in different place.
Also you forgot to include exception message.


--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Bob Hanson" <BobHanson(a)discussions.microsoft.com> wrote in message
news:90552DD7-B9AD-44FC-AC18-221C0377C1A2(a)microsoft.com...
> Hello All,
>
> I am getting errors on the MessageQueue.Create statement of:
>
> public static class CommonTools
> {
> // Since this is a private queue we follow the naming convention
> // MachineName\Private$\QPath
> // "." represents the local machine name
> public const string QPath = @".\Private$\msmqdemo";
> public static MessageQueue mesSendQ = null;
> public static MessageQueue mesReceiveQ = null;
>
> public static string CreateQueue()
> {
> try
> {
> mesSendQ = MessageQueue.Create(QPath); << Error occurs here
> return "CreateQueue Successful";
> }
> catch(Exception ex)
> {
> return ex.Message;
> }
> }
>
> This is the stacktrace that I get:
>
> at
>> System.Messaging.Interop.SafeNativeMethods.MQPathNameToFormatName()\r\nat
>> System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath()\r\nat
>> System.Messaging.MessageQueue.get_FormatName()\r\nat
>> System.Messaging.MessageQueue.SendInternal()\r\nat
>> System.Messaging.MessageQueue.Send()\r\nat
>> DemoMSMQ.Forms.testForm.buttonSend_Click()\r\nat
>> System.Windows.Forms.Control.OnClick()\r\nat
>> System.Windows.Forms.Button.OnClick()\r\nat
>> System.Windows.Forms.ButtonBase.WnProc()\r\nat
>> System.Windows.Forms.Control._InternalWnProc()\r\nat
>> Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat
>> System.Windows.Forms.Application.Run()\r\nat
>> DemoMSMQ.Forms.Program.Main()\r\n
>
> I tested this same code on the desktop and it worked fine. Is there a
> problem with my queue path syntax for cf 2.0?
>
> Thanks in advance for your help :)
>
> --
> Bob Hanson
> Senior Solutions Developer
>


From: Bob Hanson on
Hello Ilya,

Sorry I missed the exception. Here it is:

An error message cannot be displayed because an optional resource assembly
containing it cannot be found

Thanks in advance for your help :)

--
Bob Hanson
Senior Solutions Developer



"Ilya Tumanov [MS]" wrote:

> This path should work.
>
>
>
> By the way, your stack trace indicates exception happens in different place.
> Also you forgot to include exception message.
>
>
> --
> Best regards,
>
> Ilya
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> *** Want to find answers instantly? Here's how... ***
>
> 1. Go to
> http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
> 2. Type your question in the text box near "Search this group" button.
> 3. Hit "Search this group" button.
> 4. Read answer(s).
>
> "Bob Hanson" <BobHanson(a)discussions.microsoft.com> wrote in message
> news:90552DD7-B9AD-44FC-AC18-221C0377C1A2(a)microsoft.com...
> > Hello All,
> >
> > I am getting errors on the MessageQueue.Create statement of:
> >
> > public static class CommonTools
> > {
> > // Since this is a private queue we follow the naming convention
> > // MachineName\Private$\QPath
> > // "." represents the local machine name
> > public const string QPath = @".\Private$\msmqdemo";
> > public static MessageQueue mesSendQ = null;
> > public static MessageQueue mesReceiveQ = null;
> >
> > public static string CreateQueue()
> > {
> > try
> > {
> > mesSendQ = MessageQueue.Create(QPath); << Error occurs here
> > return "CreateQueue Successful";
> > }
> > catch(Exception ex)
> > {
> > return ex.Message;
> > }
> > }
> >
> > This is the stacktrace that I get:
> >
> > at
> >> System.Messaging.Interop.SafeNativeMethods.MQPathNameToFormatName()\r\nat
> >> System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath()\r\nat
> >> System.Messaging.MessageQueue.get_FormatName()\r\nat
> >> System.Messaging.MessageQueue.SendInternal()\r\nat
> >> System.Messaging.MessageQueue.Send()\r\nat
> >> DemoMSMQ.Forms.testForm.buttonSend_Click()\r\nat
> >> System.Windows.Forms.Control.OnClick()\r\nat
> >> System.Windows.Forms.Button.OnClick()\r\nat
> >> System.Windows.Forms.ButtonBase.WnProc()\r\nat
> >> System.Windows.Forms.Control._InternalWnProc()\r\nat
> >> Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat
> >> System.Windows.Forms.Application.Run()\r\nat
> >> DemoMSMQ.Forms.Program.Main()\r\n
> >
> > I tested this same code on the desktop and it worked fine. Is there a
> > problem with my queue path syntax for cf 2.0?
> >
> > Thanks in advance for your help :)
> >
> > --
> > Bob Hanson
> > Senior Solutions Developer
> >
>
>
>
From: " ctacke/>" on
First push the System_SR_ENU assembly down so you can get a useful message.
Second, the stack trace indicates the error is in
System.Messaging.MessageQueue.Send() as a result of a
DemoMSMQ.Forms.testForm.buttonSend_Click(). The code doesn't match that at
all.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--





"Bob Hanson" <BobHanson(a)discussions.microsoft.com> wrote in message
news:C67E448B-1D4C-4873-9E95-12A4B098BBFC(a)microsoft.com...
> Hello Ilya,
>
> Sorry I missed the exception. Here it is:
>
> An error message cannot be displayed because an optional resource assembly
> containing it cannot be found
>
> Thanks in advance for your help :)
>
> --
> Bob Hanson
> Senior Solutions Developer
>
>
>
> "Ilya Tumanov [MS]" wrote:
>
>> This path should work.
>>
>>
>>
>> By the way, your stack trace indicates exception happens in different
>> place.
>> Also you forgot to include exception message.
>>
>>
>> --
>> Best regards,
>>
>> Ilya
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> *** Want to find answers instantly? Here's how... ***
>>
>> 1. Go to
>> http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
>> 2. Type your question in the text box near "Search this group" button.
>> 3. Hit "Search this group" button.
>> 4. Read answer(s).
>>
>> "Bob Hanson" <BobHanson(a)discussions.microsoft.com> wrote in message
>> news:90552DD7-B9AD-44FC-AC18-221C0377C1A2(a)microsoft.com...
>> > Hello All,
>> >
>> > I am getting errors on the MessageQueue.Create statement of:
>> >
>> > public static class CommonTools
>> > {
>> > // Since this is a private queue we follow the naming convention
>> > // MachineName\Private$\QPath
>> > // "." represents the local machine name
>> > public const string QPath = @".\Private$\msmqdemo";
>> > public static MessageQueue mesSendQ = null;
>> > public static MessageQueue mesReceiveQ = null;
>> >
>> > public static string CreateQueue()
>> > {
>> > try
>> > {
>> > mesSendQ = MessageQueue.Create(QPath); << Error occurs
>> > here
>> > return "CreateQueue Successful";
>> > }
>> > catch(Exception ex)
>> > {
>> > return ex.Message;
>> > }
>> > }
>> >
>> > This is the stacktrace that I get:
>> >
>> > at
>> >> System.Messaging.Interop.SafeNativeMethods.MQPathNameToFormatName()\r\nat
>> >> System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath()\r\nat
>> >> System.Messaging.MessageQueue.get_FormatName()\r\nat
>> >> System.Messaging.MessageQueue.SendInternal()\r\nat
>> >> System.Messaging.MessageQueue.Send()\r\nat
>> >> DemoMSMQ.Forms.testForm.buttonSend_Click()\r\nat
>> >> System.Windows.Forms.Control.OnClick()\r\nat
>> >> System.Windows.Forms.Button.OnClick()\r\nat
>> >> System.Windows.Forms.ButtonBase.WnProc()\r\nat
>> >> System.Windows.Forms.Control._InternalWnProc()\r\nat
>> >> Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat
>> >> System.Windows.Forms.Application.Run()\r\nat
>> >> DemoMSMQ.Forms.Program.Main()\r\n
>> >
>> > I tested this same code on the desktop and it worked fine. Is there a
>> > problem with my queue path syntax for cf 2.0?
>> >
>> > Thanks in advance for your help :)
>> >
>> > --
>> > Bob Hanson
>> > Senior Solutions Developer
>> >
>>
>>
>>


From: Bob Hanson on
Hello Chris,

Thanks for the reply. The form button being mentioned is what click event
started the CreateQueue:

private void buttonSend_Click(object sender, EventArgs e)
{
string Result = null;
Result = CommonTools.CreateQueue();
this.listBoxResult.Items.Add(Result);
Result = CommonTools.SendMessageToQueue();
this.listBoxResult.Items.Add(Result);
}

This is in a device winforms application.

You had mentioned the following:

"First push the System_SR_ENU assembly down so you can get a useful message"

Please excuse my ignorance on this as I am not sure what is meant.

I appreciate your help and please reply when you get a chance.

--
Bob Hanson
Senior Solutions Developer



"<ctacke/>" wrote:

> First push the System_SR_ENU assembly down so you can get a useful message.
> Second, the stack trace indicates the error is in
> System.Messaging.MessageQueue.Send() as a result of a
> DemoMSMQ.Forms.testForm.buttonSend_Click(). The code doesn't match that at
> all.
>
>
> --
> Chris Tacke
> OpenNETCF Consulting
> Managed Code in the Embedded World
> www.opennetcf.com
> --
>
>
>
>
>
> "Bob Hanson" <BobHanson(a)discussions.microsoft.com> wrote in message
> news:C67E448B-1D4C-4873-9E95-12A4B098BBFC(a)microsoft.com...
> > Hello Ilya,
> >
> > Sorry I missed the exception. Here it is:
> >
> > An error message cannot be displayed because an optional resource assembly
> > containing it cannot be found
> >
> > Thanks in advance for your help :)
> >
> > --
> > Bob Hanson
> > Senior Solutions Developer
> >
> >
> >
> > "Ilya Tumanov [MS]" wrote:
> >
> >> This path should work.
> >>
> >>
> >>
> >> By the way, your stack trace indicates exception happens in different
> >> place.
> >> Also you forgot to include exception message.
> >>
> >>
> >> --
> >> Best regards,
> >>
> >> Ilya
> >>
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >> *** Want to find answers instantly? Here's how... ***
> >>
> >> 1. Go to
> >> http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
> >> 2. Type your question in the text box near "Search this group" button.
> >> 3. Hit "Search this group" button.
> >> 4. Read answer(s).
> >>
> >> "Bob Hanson" <BobHanson(a)discussions.microsoft.com> wrote in message
> >> news:90552DD7-B9AD-44FC-AC18-221C0377C1A2(a)microsoft.com...
> >> > Hello All,
> >> >
> >> > I am getting errors on the MessageQueue.Create statement of:
> >> >
> >> > public static class CommonTools
> >> > {
> >> > // Since this is a private queue we follow the naming convention
> >> > // MachineName\Private$\QPath
> >> > // "." represents the local machine name
> >> > public const string QPath = @".\Private$\msmqdemo";
> >> > public static MessageQueue mesSendQ = null;
> >> > public static MessageQueue mesReceiveQ = null;
> >> >
> >> > public static string CreateQueue()
> >> > {
> >> > try
> >> > {
> >> > mesSendQ = MessageQueue.Create(QPath); << Error occurs
> >> > here
> >> > return "CreateQueue Successful";
> >> > }
> >> > catch(Exception ex)
> >> > {
> >> > return ex.Message;
> >> > }
> >> > }
> >> >
> >> > This is the stacktrace that I get:
> >> >
> >> > at
> >> >> System.Messaging.Interop.SafeNativeMethods.MQPathNameToFormatName()\r\nat
> >> >> System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath()\r\nat
> >> >> System.Messaging.MessageQueue.get_FormatName()\r\nat
> >> >> System.Messaging.MessageQueue.SendInternal()\r\nat
> >> >> System.Messaging.MessageQueue.Send()\r\nat
> >> >> DemoMSMQ.Forms.testForm.buttonSend_Click()\r\nat
> >> >> System.Windows.Forms.Control.OnClick()\r\nat
> >> >> System.Windows.Forms.Button.OnClick()\r\nat
> >> >> System.Windows.Forms.ButtonBase.WnProc()\r\nat
> >> >> System.Windows.Forms.Control._InternalWnProc()\r\nat
> >> >> Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat
> >> >> System.Windows.Forms.Application.Run()\r\nat
> >> >> DemoMSMQ.Forms.Program.Main()\r\n
> >> >
> >> > I tested this same code on the desktop and it worked fine. Is there a
> >> > problem with my queue path syntax for cf 2.0?
> >> >
> >> > Thanks in advance for your help :)
> >> >
> >> > --
> >> > Bob Hanson
> >> > Senior Solutions Developer
> >> >
> >>
> >>
> >>
>
>
>