How to pass a delegate to an external function (dll file)

How to pass a delegate to an external function (dll) to get notified about the changes from the dll file. Also the delegate have a parameter of type structure, so that this structure holds some data from the dll. Below is the C# source. Please could some one help in converting it into xojo code.

public struct GLYPARAM
{
internal Int32 handle;
internal Int32 dwErrorCode;
internal Int32 dwMessageID;
internal IntPtr dwRequestID;
internal Int32 ulSize;
internal IntPtr lpBuffer;
internal IntPtr szParamName;
}

internal delegate void GlyCallbackDelegate(ref GLYPARAM p);
private delegate Int32 GsiOpenDelegate(string logicalName, out Int32 handle, GlyCallbackDelegate pcb);
private GsiOpenDelegate _gsiOpen;
internal Int32 GsiOpen(string logicalname, out Int32 handle, GlyCallbackDelegate callback)
{
return this._gsiOpen(logicalname, out handle, callback);
}

Do you still need help for this?
I just issued the same problem and solved it.
If still interested, I could share some code.
Let me know.

Please if you can . I overcame this issue by writing code in C#