note 39846 modified in ref.com by danbrown

From: Date: Mon, 21 Dec 2009 17:11:50 +0000
Subject: note 39846 modified in ref.com by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164217@lists.php.net to get a copy of this message
I didn't found any working examples of PHP using the MSMQ COM object, so I made up one, thought I share it with everybody..it works ok. You have to create a local Public message queue named "TestQueue" first. <?php define(MQ_SEND_ACCESS , 2); define(MQ_DENY_NONE , 0); $msgQueueInfo = new COM("MSMQ.MSMQQueueInfo") or die("can not create MSMQ Info object"); $msgQueueInfo->PathName = ".\TestQueue"; $msgQueue = new COM("MSMQ.MSMQQueue") or die("can not create MSMQ object"); $msgQueue=$msgQueueInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE ); $msgOut = new COM("MSMQ.MSMQMessage") or die("can not create MSMQ message object"); $msgOut->Body = "Hello world!"; $msgOut->Send($msgQueue); $msgQueue->Close(); unset($msgOut); unset($msgQueue); unset($msgQueueInfo); ?> enjoy PS --was-- I didn't found any working examples of PHP using the MSMQ COM object, so I made up one, thought I share it with everybody..it works ok. You have to create a local Public message queue named "TestQueue" first. define(MQ_SEND_ACCESS , 2); define(MQ_DENY_NONE , 0); $msgQueueInfo = new COM("MSMQ.MSMQQueueInfo") or die("can not create MSMQ Info object"); $msgQueueInfo->PathName = ".\TestQueue"; $msgQueue = new COM("MSMQ.MSMQQueue") or die("can not create MSMQ object"); $msgQueue=$msgQueueInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE ); $msgOut = new COM("MSMQ.MSMQMessage") or die("can not create MSMQ message object"); $msgOut->Body = "Hello world!"; $msgOut->Send($msgQueue); $msgQueue->Close(); unset($msgOut); unset($msgQueue); unset($msgQueueInfo); enjoy PS http://php.net/manual/en/ref.com.php

« previous php.notes (#164217) next »