john tirado rancidnihilism85 // User Search

john tirado rancidnihilism85 // User Search

1  |  

Prob

Jun 18, 2006, 6:39pm
Hey, Grimble,
I'm having a similar problem with installing callbacks through the use of a
delegate. I receive an access violation error via the aw_wait(), and I
noticed that you said that you had fixed it. What exactly did you do? The
callback actually works fine for me, but after the handler function
terminates, i get that exception.
Here is some of my code that is relevant to this problem:

public delegate void d1(int rc);
[DllImport("Aw.dll")]
public static extern int aw_callback_set(AwCallback
callbackhandler, d1 handler );

//inside the form_load event
//install callback handlers
aw_callback_set(AwCallback.AW_CALLBACK_OBJECT_RESULT,
this.my_callback_obj_result);

//and then the function
public void my_callback_obj_result(int rc)
{
string objModel = aw_string(AwAttribute.AW_OBJECT_MODEL);
int objNum = aw_int(AwAttribute.AW_OBJECT_NUMBER);
aw_say(objModel);
aw_say(objNum.ToString());
aw_say(rc.ToString());
}//endmethod

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn