Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Creating a Private  Queue


1 reply to this topic

bernadettefearon

bernadettefearon
  • Members
  • 94 posts

Posted 27 June 2002 - 15:54

Hi all,
The installation i am currently working on uses MTS technologies, and has to install a number of private queues on the client machine under control panelAdministrative Tools/Computer Management/MessageQueueing

Does anyone know how to do this ? Or even if it is possible to do this?
thanks for any suggestions
Berni

Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 03 July 2002 - 10:19

Definitely possible, I set up a number of queues for the main application I work on.  The following is an extract from a support dll I use.  The queue created is a public queue, but you'll get the idea from this.

Code Sample

STDMETHODIMP CMSMQUtility::CreateQueue(/*[in]*/ BSTR istrPathName, /*[in]*/ BSTR istrLabel, /*[in]*/ VARIANT_BOOL iblnTransactional, /*[in]*/ BSTR istrTypeID, /*[out, retval]*/ BSTR* ostrFormatName)
{
try
{
// Delete the queue first in case it exists.

if ( SUCCEEDED(DeleteQueue(istrPathName)) )
{
// Set the queue details.

IMSMQQueueInfoPtr pInfo(__uuidof(MSMQQueueInfo));
pInfo->PathName = istrPathName;
pInfo->Label = istrLabel;
if ( istrTypeID != NULL && ::wcscmp(istrTypeID, L"") != 0 )
pInfo->ServiceTypeGuid = istrTypeID;

// Create the queue.

CComVariant varTransactional = iblnTransactional ? true : false;
CComVariant varWorldReadable = true;

pInfo->Create(&varTransactional, &varWorldReadable);

// Return the format name.

*ostrFormatName = ::SysAllocString(pInfo->FormatName);
}
}
catch ( ... )
{
}

return S_OK;
}


It's also possible to create it through a VBScript/Installscript, but I can't remember the objects I call through VBScript.  VBScript also had problems setting queue security, because the security requires calls to Windows API functions that aren't available to VBScript.
Leigh Ravenhall
Expert Information Services