[haXe] exe to neko call

Lee McColl Sylvester lee at designrealm.co.uk
Wed Feb 21 19:52:39 CET 2007


Any idea about this?  I don't see how I can call a function from the exe 
stub, or pass the handle to the static data to a module as loadmodule 
won't accept the exe as a parameter.  Is there a way to force the handle 
into the run neko script when the vm is setup so it can be collected on 
the other side?

Thanks,
Lee




Lee McColl Sylvester wrote:
> Okay, so the static variable declaration will exist in the stub exe, 
> and I put the set_hide_window function in an ndll, right?  Or do I put 
> it also in the exe?  If in the exe, how do I access the function?
>
> Thanks,
> Lee
>
>
>
>
> Nicolas Cannasse wrote:
>>> Sorry, theres a lot of crap in there.  Try
>>>
>>> void TaskBar::OnMenuRestore(wxCommandEvent& )
>>> {
>>>    value mload = neko_default_loader(NULL, 0);
>>>    val_call0(val_field(mload,val_id("hideWindow")));
>>> }
>>
>> neko_default_loader allocate a new loader which does not have a 
>> hideWindow method. And it's not easy to retreive the current loader 
>> (since you are outside of a Neko module it would not make sense).
>>
>> Try setting a callback first, store it into a alloc_root(1) block, 
>> and use it :
>>
>> static value *hwindow = NULL;
>>
>> value set_hide_window( value v ) {
>>     val_check_function(v,0);
>>     if( hwindow == NULL ) hwindow = alloc_root(1);
>>     *hwindow = v;
>>     return val_null;
>> }
>>
>> ...
>>
>> if( hwindow != NULL )
>>     val_call0(*hwindow);
>>
>> Nicolas
>>
>
>




More information about the Haxe mailing list