Options

Returning a string to Navision, from a COM

ombackeombacke Member Posts: 44
I return from a cmethod in my dll a string, when I call that method form navisiom and try to put the return value in a Navision Text[1024] variable, it tell me that the string size is too big for the buffer size.. But the string return by my method is just 339 characters long.. Why is that?

Comments

  • Options
    ara3nara3n Member Posts: 9,256
    It's not your string size, but the Navision executable wrapper that is the intermediate between the COM and your text string that is 250 characters long. You can't do much about that.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    ombackeombacke Member Posts: 44
    Is it the same with Navision 4.0?
  • Options
    ara3nara3n Member Posts: 9,256
    I don't know I haven't tried it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    wakestarwakestar Member Posts: 207
    no solution in sight? I've got the same problem with Navision 4.0 :roll:
  • Options
    ara3nara3n Member Posts: 9,256
    try to change the method to return stream or an object or change your method to return 250 characters at a time. So call it like this

    while com.mymethod(var str) do begin
    1024string := 1024string + str;
    end;
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.