Board index » delphi » Question of ActiveX Server Such as MSMQ Using in D6 SP2

Question of ActiveX Server Such as MSMQ Using in D6 SP2

Dear Sir,
I use MSMQ V2.0 in D5 w/ SP1 ,the codes are correct.

var
  MSMQMessage:TMSMQMessage;
begin
  MSMQMessage := TMSMQMessage.Create(Application);
  MSMQMessage.Label_ := 'Message Label';
  MSMQMessage.Body := Edit1.Text;
  MSMQMessage.Send(iq);
  MSMQMessage.free;
end;

but in D6 w/ SP2 it reports error. I changed them to the following form,
then it runs well.

var
  MSMQMessage:TMSMQMessage;
begin
  MSMQMessage := TMSMQMessage.Create(Application);
  MSMQMessage.DefaultInterface.Label_ := 'Message Label';
  MSMQMessage.DefaultInterface.Body := Edit1.Text;
  MSMQMessage.Send(iq);
  MSMQMessage.free;
end;

I wonder why I must use the interface of its class to set the properties in
D6, while it's not necessarily in D5.

Thanks in advance.

CMS
2002/03/21

 

Re:Question of ActiveX Server Such as MSMQ Using in D6 SP2


Why not try using an interface like the following psuedo code instead of
using the delphi component wrappers.

var
 objMsg: IMSMQMessage2;
 Transaction: OleVariant;
begin
 objMsg:=CoMSMQMessage.Create;
 objMsg.Body := 'BLAH';
 objMsg.Label_ := 'Test Msg';
 Transaction:=MQ_NO_TRANSACTION;
 objMsg.Send(<Some IMSMQQueue2 Instance>, Transaction);

I think you'll find this easier to implement..

HTH.

-abaum

Re:Question of ActiveX Server Such as MSMQ Using in D6 SP2


When using the interface directly it works.  But why do the Delphi
wrappers that used to work in D5 no longer work in D6?????????

Steve

Quote
"Andrew Baum" <ab...@abaum.com.nospam> wrote in message <news:3ca01c3d$1_1@dnews>...
> Why not try using an interface like the following psuedo code instead of
> using the delphi component wrappers.

> var
>  objMsg: IMSMQMessage2;
>  Transaction: OleVariant;
> begin
>  objMsg:=CoMSMQMessage.Create;
>  objMsg.Body := 'BLAH';
>  objMsg.Label_ := 'Test Msg';
>  Transaction:=MQ_NO_TRANSACTION;
>  objMsg.Send(<Some IMSMQQueue2 Instance>, Transaction);

> I think you'll find this easier to implement..

> HTH.

> -abaum

Other Threads