Re: Using handles with C++

From: Christian Fritz <Christian.Fritz_at_post.rwth-aachen.de>
Date: Wed 26 Feb 2003 09:28:21 PM GMT
Message-ID: <3E5D3175.5060203@post.rwth-aachen.de>
first of all, thanks for the quick answer.

Joachim Schimpf wrote:

>>As described in the embedding manual we are trying to pass generic C++
>>data to ECLiPSe. We are facing two problems:
>>
>>1. The struct type (t_ext_type) for setting up a proper method table is
>>differently defined (in types.h and eclipse_cc.h) from what is said in
>>the manual. As far as we can see, it is for pure C programming (using
>>pword instead of EC_word..).
>>    
>>
>
>It will probably work anyway (but I haven't verified this).
>
>  
>
Unfortunately the compiler already complains about this mismatch.

>>2. After getting a handle we'd like to store it somewhere in eclipse for
>>further accessing the data. We are able to obtain a handle and xget some
>>data. But when trying to save this handle (e.g. assert(
>>myHandle(Hbound)) ) and recalling it (myHandle(Hyet_unbound)), we
>>immediately receive a segmentation violation.
>>    
>>
>
>You need to provide a copy-method for this to work. It seems that
>assert/1 erroneously does not detect this problem.
>Try setval/getval instead of assert, and make sure you have a copy-
>function defined.
>  
>
Tried that already: setval(myhandle, H) with H bound to the handle gives:
"type error in setval_body(myhandle, 'HANDLE'(16'40192468), eclipse)."
We were using the predefined 'ec_xt_double_arr'. Doesn't that have a 
copy-function defined?
Received on Wed Feb 26 21:33:44 2003

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:22 PM GMT GMT