Help me With My code
-
I wrote this code to send msg to MSMQ , but it did not work can any one give me any idea to fix it,if there is something wrong ? this is my queue -> gateway\private$\newqueue --------------------------------
#include "stdafx.h" #include <stdio.h> #include <atlbase.h> #include <iostream> #import <mqoa.dll> using namespace MSMQ; using namespace std; void Send(); int main(int argc, char* argv[]) { Send(); return 0; } void Send() { IMSMQQueueInfoPtr spQInfo("MSMQ.MSMQQueueInfo"); spQInfo->PutPathName(SysAllocString(OLESTR(".\\newqueue"))); IMSMQQueuePtr spQSend = spQInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE); IMSMQMessagePtr spQMsg("MSMQ.MSMQMessage"); spQMsg->Label = "This is a Word Document2"; spQMsg->Body = "My Boudy"; spQMsg->Send(spQSend); spQSend->Close(); }
-- modified at 18:41 Wednesday 19th April, 2006 -
I wrote this code to send msg to MSMQ , but it did not work can any one give me any idea to fix it,if there is something wrong ? this is my queue -> gateway\private$\newqueue --------------------------------
#include "stdafx.h" #include <stdio.h> #include <atlbase.h> #include <iostream> #import <mqoa.dll> using namespace MSMQ; using namespace std; void Send(); int main(int argc, char* argv[]) { Send(); return 0; } void Send() { IMSMQQueueInfoPtr spQInfo("MSMQ.MSMQQueueInfo"); spQInfo->PutPathName(SysAllocString(OLESTR(".\\newqueue"))); IMSMQQueuePtr spQSend = spQInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE); IMSMQMessagePtr spQMsg("MSMQ.MSMQMessage"); spQMsg->Label = "This is a Word Document2"; spQMsg->Body = "My Boudy"; spQMsg->Send(spQSend); spQSend->Close(); }
-- modified at 18:41 Wednesday 19th April, 2006ALQallaf wrote:
...but it did not work
Which means nothing if you don't tell us which part did not work. Your code has no error checking. What does the
Send()
method return?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
ALQallaf wrote:
...but it did not work
Which means nothing if you don't tell us which part did not work. Your code has no error checking. What does the
Send()
method return?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
ALQallaf wrote:
...but it did not work
Which means nothing if you don't tell us which part did not work. Your code has no error checking. What does the
Send()
method return?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb