David Piepgrass | 2 Apr 2011 01:24
Favicon

Re: return a struct by reference without creating a handler wrapper class

xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

Well, you could also allocate the string with malloc() and wrap free() with SWIG:

 

%cs_struct(void*, IntPtr)

void free(void* ptr);

 

From: Sergio Gómez Villamor [mailto:sgomez <at> ac.upc.edu]
Sent: Friday, April 01, 2011 11:39 AM
To: David Piepgrass
Cc: swig-user <at> lists.sourceforge.net
Subject: Re: [Swig-user] return a struct by reference without creating a handler wrapper class

 

OK, I will try this although I don't like it very much because if I have to allocate the string using SysAllocString, that means the allocation of the string will depend on the target language I'm compiling to.

 

Anyway, I will try this next week (it's my time to leave). 

 

Thanks very much,

Sergio

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user

Gmane