Re: EuCom
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Sep 25, 2005
- 462 views
Tone Škoda wrote: > > Matt, I just wanted to mention that there is a problem in > call_interface_ptr(), > actually the problem is really in fptr.e in call_stdcall_proc(): > > First argument of MediaDet_WriteBitmapBits is > double which is 8 bytes long. call_interface_ptr() expects > that all arguments are 4 bytes long because it uses poke4(). > It should use poke() and should take another argument: > params_sizes. We are unable to call function with parameters which are char > (=1 byte) > for example. > I think that it would be simplest if it would imitate the way Euphoria dll > calling > functions work: define_c_func... > As I said I found workround but future people using EuCom will probably get > confused > over this. > > frame_pos_bytes = atom_to_float64 (frame_pos) > retVal = call_interface_ptr (this, vtbl, MediaDet_WriteBitmapBits, > -- split double into two atoms. > bytes_to_int (frame_pos_bytes [1..4]) & bytes_to_int (frame_pos_bytes > [5..8]) > & {dest_width, dest_height, dest_fname_ptr}) > Thanks, I hadn't run into any functions like this before, so I didn't really consider it. But I'll think about how to solve this. I don't really like duplicating the define_c_* API, because it means I'll have to keep track of all that, but it may be the only way. Matt Lewis