milosev.com
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home

Deploying MSMQ 3.0 Applications with DCOM

Details
Written by: Stanko Milosev
Category: MSMQ
Published: 18 December 2008
Last Updated: 12 December 2009
Hits: 6371

If you are using my application for MS MQ to deploy on another computer, to send messages you will need to do following:

1. Log on as the local administrator for the client computer, and then open Component Services. Click Start, point to All Programs, point to Administrative Tools, and then click Component Services.
2. In the console tree, click Component Services, click Computers, click My Computer, and then click DCOM config.
3. Right-click MSMQ, and then click Properties.
4. On the Location tab, select Run application on the following computer, and type the name of the Message Queuing server. Save the settings, and restart the computer

Taken from here.

Few links.

Details
Written by: Stanko Milosev
Category: MSMQ
Published: 10 December 2008
Last Updated: 10 December 2008
Hits: 8057

Here are few links, which I found interesting about MSMQ:

Lets do message queue

MSMQ best practice

MSMQ FAQ

Microsoft Message Queuing

Details
Written by: Stanko Milosev
Category: MSMQ
Published: 09 December 2008
Last Updated: 10 December 2009
Hits: 8416

First of all you have to install MSMQ. You will do it through Control panel->Add remove programs->Add/Remove Windows components.

Second you will need to access MSMQ for managing, you can do it through Computer Management->Services and Applications->Message Queuing

Now, create one queue, for example "test", under Private Queues.

Then, send a message through Delphi :)

Here is the code:

For sending messages:

procedure TForm3.Button1Click(Sender: TObject);
var
queuename, subject: string;
data: olevariant;
queueinfo, QueueInfosObj: IMSMQQueueInfo;
queue, QueryObj: IMSMQQueue;
msg: IMSMQMessage;
tr: OLEVariant;
begin
{ STANKO is name of my computer, test is name of queue}
queuename := 'Direct=OS:STANKOprivate$ est';
subject := Edit1.text;
data := Memo1.text;

try
queueinfo := CreateCOMObject (CLASS_MSMQQueueInfo) as IMSMQQueueInfo;
queueinfo.FormatName := queuename;
queue := queueinfo.Open (MQ_SEND_ACCESS, MQ_DENY_NONE);
if queue.IsOpen 1 then
statusbar1.Panels[0].Text := 'I can not get access to queue!'
else
begin
try
msg := CreateCOMObject (CLASS_MSMQMessage) as IMSMQMessage;
msg.label_ := subject;
msg.body := data;
tr := MQ_NO_TRANSACTION;
msg.Send (queue, tr);
statusbar1.Panels[0].Text := 'Sent!'
finally
queue.close;
end;
end;
except
on e: exception do showmessage (e.message);
end;
end;

Now, for receiving messages:

procedure TForm3.Button2Click(Sender: TObject);
var
queuename: string;
data: olevariant;
queueinfo: IMSMQQueueInfo;
queue: IMSMQQueue;
msg: IMSMQMessage;
tr, wdq, wb, rt: OLEVariant;
begin
queuename:= 'Direct=OS:STANKOprivate$ est';
try
queueinfo := CreateCOMObject (CLASS_MSMQQueueInfo) as IMSMQQueueInfo;
queueinfo.FormatName := queuename;
queue := queueinfo.Open (MQ_RECEIVE_ACCESS, MQ_DENY_NONE);
if queue.IsOpen 1 then
statusbar1.Panels[0].Text := 'I can not get access to queue!'
else
begin
try
tr := MQ_SINGLE_MESSAGE;
wdq := False;
wb := True;
rt := 1000;
msg := queue.Receive (tr, wdq, wb, rt);
if msg nil then
begin
data := msg.body;
statusbar1.Panels[0].Text := 'Received!';
memo2.text:=data;
edit2.text:=msg.label_;
end
else
statusbar1.Panels[0].Text := 'No messages'
finally
queue.close;
end;
end;
except
on e: exception do showmessage (e.message);
end;
end;

Code taken from here. It is on Slovenian, but I coudn't find it on English.

Here you can download source code created in D2007, and here is the exe file.

ORA-00904: invalid identifier

Details
Written by: Stanko Milosev
Category: Oracle
Published: 18 March 2009
Last Updated: 30 November -0001
Hits: 8846
If you ever received this error then try to write field names in the Oracle with upper case, or use quotas.
  1. ora-01036 illegal variable name/number
  2. Warning: date()
  3. Data source name not found and no default driver specified
  4. The specified module could not be found.

Subcategories

C#

Azure

ASP.NET

JavaScript

Software Development Philosophy

MS SQL

IBM WebSphere MQ

MySQL

Joomla

Delphi

PHP

Windows

Life

Lazarus

Downloads

Android

CSS

Chrome

HTML

Linux

Eclipse

Page 101 of 168

  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105