From: Gomez on 4 Apr 2010 18:45 I posted the following question first to a CSAHRP NG but actually I was wrong-its an MFC problem and I hope someone here can really help me... I use the following code in a CSHARP project where I craete an MSMQ. It works fine if I send messages from another CSHARP project. UDP_Dll_Que = new MessageQueue(".\\Private$\\UDP_Dll_Que"); UDP_Dll_Que.Formatter = new BinaryMessageFormatter(); UDP_Dll_Que.ReceiveCompleted += new ReceiveCompletedEventHandler(Msmq_ReceiveCompleted); UDP_Dll_Que.BeginReceive(); I want to send message from an VS2008, MFC based projrct. The following code(passed compilation) based on the doc doesn't send - probably I miss something... IMSMQQueueInfoPtr qinfo("MSMQ.MSMQQueueInfo"); IMSMQQueuePtr qSend; IMSMQMessagePtr m("MSMQ.MSMQMessage"); qinfo->PathName = ".\\Private$\\UDP_Dll_Que"; qSend = qinfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE); m->Body = "body"; m->Send(qSend); qSend->Close(); Can someone write some code to do that? Regards Gomez
From: JohnBrea on 4 Apr 2010 19:20 Hi, When you say "doesn't send", what happens? An exception is raised? No message appears in the local private queue? Cheers John Breakwell (ex-MSFT) --- frmsrcurl: http://msgroups.net/microsoft.public.vc.mfc/MSMQ-problem
From: Gomez on 5 Apr 2010 02:10 Thanks No message appears in the local private queue. I have a break point in the receive event method and it never hit. Gomez "JohnBrea" <user(a)msgroups.net/> wrote in message news:OSrlz1E1KHA.220(a)TK2MSFTNGP06.phx.gbl... > Hi, > When you say "doesn't send", what happens? > An exception is raised? > No message appears in the local private queue? > > Cheers > John Breakwell (ex-MSFT) > > --- > frmsrcurl: http://msgroups.net/microsoft.public.vc.mfc/MSMQ-problem >
From: Goran on 5 Apr 2010 11:28 On Apr 5, 12:45 am, "Gomez" <go...(a)automail.com> wrote: > I posted the following question first to a CSAHRP NG but actually I was > wrong-its an MFC problem and I hope someone here can really help me... > I use the following code in a CSHARP project where I craete an MSMQ. It > works fine if I send messages from another CSHARP project. > > UDP_Dll_Que = new MessageQueue(".\\Private$\\UDP_Dll_Que"); > > UDP_Dll_Que.Formatter = new BinaryMessageFormatter(); > > UDP_Dll_Que.ReceiveCompleted += new > ReceiveCompletedEventHandler(Msmq_ReceiveCompleted); > > UDP_Dll_Que.BeginReceive(); > > I want to send message from an VS2008, MFC based projrct. The following > code(passed compilation) based on the doc doesn't send - probably I miss > something... > > IMSMQQueueInfoPtr qinfo("MSMQ.MSMQQueueInfo"); > > IMSMQQueuePtr qSend; > > IMSMQMessagePtr m("MSMQ.MSMQMessage"); > > qinfo->PathName = ".\\Private$\\UDP_Dll_Que"; > > qSend = qinfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE); > > m->Body = "body"; > > m->Send(qSend); > > qSend->Close(); > > Can someone write some code to do that? I can't (sorry), but I can tell you that there's 0% MFC in the code you posted, and hence has 0 connection to this newsgroup. You seem to be fishing for someone to write you code, and that's not nice. Goran.
|
Pages: 1 Prev: CImage trouble on Windows 7 Next: GetAsyncKeyState(VK_LBUTTON) true after DoModal() |