http://rosettacode.org/wiki/Call_a_foreign-language_function

This looks like a simple task, though with OS specific
aspects.

   require 'dll'
   strdup=: 'msvcrt.dll _strdup >x *' cd <

   memr 0 _1 ,~ P=:strdup 'Hello World!'
Hello World!

This is easy, right?

My problem comes when I try to free the memory allocated by strdup.

   memf P
crashes.

According to microsoft's documentation, I am supposed
to be using LocalFree on that result.  However
   'kernel32.dll LocalFree n x'  cd <P
(or using * instead of x) also crashes.

Does anyone know what is going on here?

Thanks,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to