Our company is preparing to use NAS, but I am having trouble simply reading from the MS Message Queue. I have read the
"Say Hello to Navision" article at MSDN and copied its code. I was able to write to the queue successfully from Navision but every time I try to read from it, Navision crashes with a general error. The message in the queue disappears when this happens.
I'm now trying to read plain text from the queue instead of XML. It still crashes. I've tried other sample code I found on these forums and in the help files included
in this download, but Navision always crashes when I try to read the queue.
I understand about single instance codeunits and doing CREATEs for my Automation objects, so I don't think the problem is there. My code for the MessageReceived event is:
Comcom::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
InMsg := InMessage;
InStr := InMsg.GetStream;
InStr.READTEXT(Line);
InStr is an Instream variable. Line is Text 250. Navision crashes on the READTEXT statement. When I debug, right before this line executes, InStr.EOS is False but InStr is blank when I view C/AL Globals.
My queue is Nontransactional and I have granted all users full control to it. The queue contains single-byte ASCII text. (I've tried it with UTF7, UTF8 and BigEndian encoding as well but nothing works.)
My problem is identical to the problem described
here, except he gets an error message instead of Navision crashing. There it is suggested that it is a problem with Navision versions earlier than 3.7. I'm using Navision 2.65. However, I've talked to an associate who claims that he has used MSMQ in 2.65 without problems.
Please help. I've already wasted about a week on this!
Comments
you have to install the dll's of version 3.70. Only the dlls not the nas server.