Navision MS-Message Queue Bus Adapter error

vasvovec
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):
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?
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:
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."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."
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?
0
Answers
-
automations are always a pain... try create(comcom,true,true) and (mqbus,true,true)
0 -
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.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions