
Passing of C language's union data type in VB application
I have a DLL which is been generated by C language. there is function in
this DLL . this function has a parameter whose type is C language's union
data type .its defination as follow:
typedef union
{
long lvalue
float fValue
int iValue
}
I declared this function in vb envrionment as follow:
declare function myFun lib "ab.dll"(byval a as integer ,
s as any) as long
parameter s coresponding to C language 's union data type.
How to declare this function and to call this function in VB??????
I have another function in this DLL whose parameter is address(callback
function'pointer).ideclare thid function in VB as follow:
declare function myFun1 lib"ad.dll"(a as integer ,byval Proc as long) as
long
parameter Proc is function's address.
I call this function in VB as follow:
myFun1(1,addressof VBFun)
this callback function has a parameter being passed by C language's DLL.
this parameter is been defined as union data type .I declare this function
in VB as follow:
VBFun(a as variant)
In Running, VBFun can be called.but when I use it's parameter VB will get
Error .
How to use thid parameter????
thank in advance