Passing of C language's union data type in VB application 
Author Message
 Passing of C language's union data type in VB application

use the Any param, and make sure you pass the RIGHT type in,
ByVal, not ByRef.

Michael

P.S. This question was answered for you yesterday, did you
miss it?


Quote:
> 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
Quote:
> in VB as follow:

> VBFun(a as variant)
> In Running, VBFun can be called.but when I use it's

parameter VB will get

- Show quoted text -

Quote:
> Error .

> How to use thid parameter????

> thank in advance





Fri, 07 Sep 2001 03:00:00 GMT  
 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




Sat, 08 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. problem of converting C's union type to VB's a data type

2. problem of converting C's union type to VB's a data type

3. Declaring C-Language Union and Bit-field data types in Visual Basic

4. Declaring C-Language Union and Bit-field data types in Visual Basic

5. VB 5.0 and Inter-language Data Type Conversions (COBOL) and Parameter Passing

6. VB 5.0 and Inter-language Data Type Conversions (COBOL) and Parameter Passing

7. VB 5.0 and Inter-language Data Type Conversions (COBOL) and Parameter Passing

8. Does VB a similar data type like the C++ Union type

9. Does VB a similar data type like the C++ Union type

10. Union Data type in VB??

11. Passing Single Data types to DLL's

12. microsoft's policy of adopting vb as the macro language for all its biz applications

 

 
Powered by phpBB® Forum Software