vc里面方法定义:
int TV_GetEvent(int ch,TV_Event *event);
其中TV_Event是个结构
typedef struct {
int  Type; // Type of Event
int  Channel; // Channel 
//union EDATA
DATASTR data;//DATASTR也是自定义的结构体
}TV_Event;vb中应该如何声明以及调用呢?
谢谢

解决方案 »

  1.   

    Type TV_Event
      Type As Long
      Channel Asong
      data As DATASTR
    End TypePublic Declare Function TV_GetEvent Lib "yours.Dll" _
        (Byval ch As Long, TV_Event As Type) As Long
      

  2.   

    错了,这样:Public Declare Function TV_GetEvent Lib "yours.Dll" _
        (Byval ch As Long, event As TV_Event) As Long
      

  3.   

    唉,真是的。
    我把结构的定义放在Module里了,而不是class Module里
    结果编译的时候总是提示出错:
    "Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types"
    我写的声明和调用倒是对的。
    还是很谢谢of123(),这么快就答复我。
    分都给你了