Prev: Create an owner drawn ListBox
Next: Best TreeListView control for showing hierarchical structures (like XML)
From: Gomez on 4 Apr 2010 17:38 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 |