How to handle text of length more than 1024

ajaybabuCh
Member Posts: 208
Hi
I have registered a dll to Navision. One of dll's function is returning the text more than 1024 length.
How to handle this situation.
Here is the code which I tried
Var Name Type subtype
AutomationVar Automation which will point to my new registered dll
BigTextVar BigText
Code :
BigTextVar.AddText(AutomationVar.GetText());
//AutomationVar.GetText() getting text more than 1024 characters.
here I am getting the error "length of the text string is exceeds size of the bugger.
is there any way to handle this situation
I have registered a dll to Navision. One of dll's function is returning the text more than 1024 length.
How to handle this situation.
Here is the code which I tried
Var Name Type subtype
AutomationVar Automation which will point to my new registered dll
BigTextVar BigText
Code :
BigTextVar.AddText(AutomationVar.GetText());
//AutomationVar.GetText() getting text more than 1024 characters.
here I am getting the error "length of the text string is exceeds size of the bugger.
is there any way to handle this situation
Ajay
0
Comments
-
Actually the text which is coming in is in xml format, I also tried the following code
XMLDom.loadXML(AutomationVar.GetText());
Where XMLDom is of type 'Microsoft XML, v3.0'.DOMDocument'
still getting the same error "length of the text string is exceeds size of the buffer"
any idea on thisAjay0 -
any guess on thisAjay0
-
If the return value of GetText is resolved in NAV as Text datatype, you have the 1024 bytes limit regardless how you will use the function. If there is no other way how to read the data, you will need to do some wrapper library around that which will read the text and you will be able to read this text through Stream o part by part.0
-
you can use the NATHash.dll from Navision to receive Strings > 1024 characters
while i'm not in office this time i post the code later
Regards,
Markus0 -
bluesky29 wrote:you can use the NATHash.dll from Navision to receive Strings > 1024 characters
while i'm not in office this time i post the code later
Regards,
Markus
I don't think it's possible unless you use 2009 RTL with variant type. But I would like to see it.if isclear(xmldom) then create(xmldom); if isclear(NATHash) then create(NATHash); xmldom.async := false; xmldom.load('C:\xmlfile.xml'); NATHash.BSTR(xmldom.text);
The last line above will still error out.0 -
here ist the code:
XlRange := XlWrkSht.Range('A1').SpecialCells(11);
Maxi := XlRange.Row;
Maxj := XlRange.Column;
i := FirstRowNo;
REPEAT
j := 1;
xlRowID := FORMAT(i);
REPEAT
xlColID := GetExcelColumn(j);
CASE xlColID OF
'K' : BEGIN
CREATE(bcon);
y := 1;
x := 0;
bcon.BSTR(XlWrkSht.Range(xlColID + xlRowID).Value);
WHILE x < bcon.GetBSTRLength DO BEGIN
bcon.GetNextStringPortion(ImpExtText[y],1024);
x += 1024;
y +=1;
END;
CLEAR(bcon);
END;
we use excel to import nonstock item text. this works.
Maybe you need to import the value of a single field of the xml0 -
I would have to say that the following code
bcon.BSTR(XlWrkSht.Range(xlColID + xlRowID).Value);
would error if the cell has more than 1024 characters.0 -
i've tested this with 5.0 Client
works fine - no error0 -
I've tested with 5.0 sp1 and 2009.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