Navision MS-Message Queue Bus Adapter error

vasvovecvasvovec Member Posts: 8
Greetings to all.
I want to make code that will work with MSMQ. I use Nav2009 R2. Communication component (NSComCom2.dll and MSMQBusAdapter.dll) are installed and registered with regsvr32. Then I created private queue "test". Then I wrote simple code in codeunit (SingleInstance = Yes):
OnRun()
IF ISCLEAR(ComCom) THEN
  CREATE(ComCom)
IF ISCLEAR(MQBus) THEN
  CREATE(MQBus) THEN
MQBus.OpenReceiveQueue('.\private$\test', 0, 0);
ComCom.AddBusAdapter(MQBus, 1);

ComCom::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
ComIn := InMessage; 
InStr := ComIn.GetStream; 
InStr.READTEXT(lTxt);
MESSAGE(lTxt);
Then I also wrote simple form with button to send simple message to test. I ran codeunit and for the first time test was good. I clicked button several times and got several messages. BUT. I added some strings in code of form, reopened the DB in Nav and tried test again. And then I started getting an error message at the running codeunit:
"this message is for C/AL Programmers:
an exception was raised in method OpenReceiveQueue. The OLE Control or Automation server returned error(HRESULT) -2147352567.
the component did not provide the exception description."
Windows (Win 10 x64) restart didn't help. When I tried to test that codeunit and form on the another machine (Win Server 2019 x64) it was also successfully only for the first test. And for the next test I got that error. Then I also tried to call MQBus.CreateQueue('.\private$\test2') but got same error.
I want to use Automation.’Navision Communication Component version 2′.CommunicationComponent because of event MessageReceived(). I also tried to use ‘Microsoft Message Queue 3.0 Object Library’ and it allows me to receive and send messages. But without event, only by timer.
Can anybody help me?

Answers

  • txerifftxeriff Member Posts: 500
    automations are always a pain... try create(comcom,true,true) and (mqbus,true,true)


  • vasvovecvasvovec Member Posts: 8
    No. It is not a solution in my case :'( Even this simple example as I wrote upper:
    IF ISCLEAR(MQBus) THEN
      CREATE(MQBus, TRUE); //third parameter isn't used for classic client
    MQBus.CreateQueue('.\private$\TestQueue');
    
    throws the same error:
    "this message is for C/AL Programmers:
    an exception was raised in method CreateQueue. The OLE Control or Automation server returned error(HRESULT) -2147352567.
    the component did not provide the exception description."

    HRESULT is 0x80020009, but in Development guide for Communication Components there are no such error code. Here https://windows-hexerror.linestarve.com/0x80020009 the are also no information.
Sign In or Register to comment.