现在有一个c写的DLL,dll接口的头文件如下:#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#if defined(WIN32)  ||  defined(_WIN32_WCE)
#include <windows.h>
#include <winsock.h>
#else
#include <sys/socket.h>
#endif#ifdef BUILDING_DLL
#if defined(WIN32)  ||  defined(_WIN32_WCE)
#  define EXPORT  _stdcall _declspec(dllexport)
#else
#  define EXPORT
#endif
#else
# define EXPORT
#endif
#define IAXC_EVENT_BUFSIZ 256
struct iaxc_ev_levels {
float input;
float output;
};struct iaxc_ev_text {
int type;
int callNo; /* call number for IAX text */
char message[IAXC_EVENT_BUFSIZ];
};struct iaxc_ev_call_state {
int callNo;
int state;
int format;
char remote[IAXC_EVENT_BUFSIZ];
char remote_name[IAXC_EVENT_BUFSIZ];
char local[IAXC_EVENT_BUFSIZ];
char local_context[IAXC_EVENT_BUFSIZ];
};struct iaxc_netstat {
        int jitter;
        int losspct;
        int losscnt;
        int packets;
        int delay;
        int dropped;
        int ooo;
};struct iaxc_ev_netstats {
int callNo;
int rtt;
struct iaxc_netstat local;
struct iaxc_netstat remote;
};struct iaxc_ev_url {
int callNo;
int type;
char url[IAXC_EVENT_BUFSIZ];
};struct iaxc_ev_video {
int callNo;
int format;
int width;
int height;
unsigned char *data;
};struct iaxc_ev_registration {
    int id;
    int reply;
    int msgcount;
};typedef struct iaxc_event_struct {
struct iaxc_event_struct *next;
int type;
union {
struct iaxc_ev_levels  levels;
struct iaxc_ev_text  text;
struct iaxc_ev_call_state  call;
struct iaxc_ev_netstats  netstats;
struct iaxc_ev_url          url;
struct iaxc_ev_video video;
struct iaxc_ev_registration reg;
} ev;
} iaxc_event;typedef int (*iaxc_event_callback_t)(iaxc_event e);
EXPORT void iaxc_set_event_callback(iaxc_event_callback_t func);
#ifdef __cplusplus
}
#endif#endif
现在想在delphi 中使用 该DLL,对回调函数的定义如下:Tiaxc_event_callback_t = function(e:iaxc_ev_levels):integer;stdcall;procedure iaxc_set_event_callback(func:Tiaxc_event_callback_t);stdcall external 'iaxclient.dll'function iaxc_event_callback_t(e:iaxc_ev_levels):integer;stdcall;
var
  i:Double;
begin
  i:=e.input;
  showmessage('aa');
end;
iaxc_set_event_callback(@iaxc_event_callback_t) ;  //调用回调函数
在执行回调函数的时候,报内存异常。请高手指点!!!!