Author Topic: Return large buffers to slick C from DLL interface  (Read 7456 times)

slickMark

  • Community Member
  • Posts: 11
  • Hero Points: 0
Return large buffers to slick C from DLL interface
« on: November 06, 2006, 06:54:38 PM »
How can I return large amounts of data (maybe several kilobytes in text format)
from a DLL interface function to the slick C macro that called it.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7040
  • Hero Points: 534
Re: Return large buffers to slick C from DLL interface
« Reply #1 on: November 06, 2006, 08:08:56 PM »
If the string is only say 100k, you're ok using just a string.  Define a function with an HREFVAR parameter instead of defining a function which returns a strings.  That way, the interpreter does not have to convert the string and push it onto the stack.  For really large data, you might want to use an editor buffer since it has no size limit.  From Slick-C use _create_temp_view, _open_temp_view, _delete_temp_view.  These functions create an editor window (int wid) which you can treat like an object.  vsInsertLine(wid,...).

Hope this helps.