String from Automation

[BSTR AVLPI_RefreshData :=] AVLPI.AVLPI_RefreshData(DataSetName, Parameters) AVLPI is a Automation object and the AVLPI_RefreshData function is sending me a string. This string is rather large (>1024 bytes) and I have been unable to work out how I can get it into a file, blob or bigtext field without experiencing a buffer string overflow. Is there someway I can break it up into pieces as it comes in - reading it in char by char perhaps? Unfortunately I do not have the abilty to write a wrapper as I have seen suggested in other threads. I’d appreciate any suggestions. Thanks in advance. Craig

In Nav 4.0 there comes a wrapper for converting BSTR to Navision strings (max. 1024). Might exist in earlier versions as well. I’ve not used it yet, but it could help you: Automation server “Navision Attain Hash 1.0”, class “BSTRConverter”. Seems to be pretty easy to use, but again, I have not yet tested it. It seems to be possible to assign it even if it is bigger than 1024 characters. compare OLHandler::OContactChanged event in Outlook Application Management codeunit (5072)

Craig, if you are on version 3 upward, you could have a look at INSTREAM and OUTSTREAM, which will allow you to handle large strings, and then convert them to smaller strings within Navision. You’ll find plenty of information in the forum, though it’s a bit difficult to work out how this works in the beginning… Saludos Nils