TPThompson 0 Report post Posted October 25, 2003 you have any working examples of using this? sorry if i overlooked something in the samples. I am specifically trying to work with this TidyLib function: /** Save to given TidyBuffer object */ TIDY_EXPORT int tidySaveBuffer( TidyDoc tdoc, TidyBuffer* buf ); and it seems that the signature (int*, int*) seems to work, and the dll actually objected to being passed a pointer to a Struct. From docs: This constructor should be used when it is required to pass a character buffer of a certain size as an argument, in particular, when it has to be passed to an output or input/output parameter. Share this post Link to post Share on other sites
mavr 0 Report post Posted November 12, 2003 It seems there is no one in samples. The possible usage is as follows: Suppose native C code that append some suffix to the received string: void foo(char* str) { strcat(str, "_suffix"); } In this case, passing the argument created by "new Argument(str, Argument.CSTRING)" is incorrect, as native function would damage the memory beyond the bounds of the allocated buffer. So, we need a way to allocate the buffer for the string of the arbitrary size. The way is using the constructor Argument(String, int, int): Argument arg = new Argument(str, Argument.CSTRING, str.length() + 7); Share this post Link to post Share on other sites