passing arrays of user defined types to dll's 
Author Message
 passing arrays of user defined types to dll's

I'd like to pass an array of user defined type
to a dll by reference.  I'm not sure whether
what I'm doing is a correct way.  Could somebody
give me a hint before I waste too much time?

Krystof



Fri, 10 Apr 1998 03:00:00 GMT  
 passing arrays of user defined types to dll's

Quote:
>I'd like to pass an array of user defined type
>to a dll by reference.  I'm not sure whether
>what I'm doing is a correct way.  Could somebody
>give me a hint before I waste too much time?

When you call the function, pass it the first element of the array. E.g.

  /* C code */
  typedef struct
  {
      int i;
      long l;  // or whatever
  }   MyType;
  void FAR Pascal _export MyDllFunction(MyType FAR *MyArray);

  ' VB code
  Type MyType
      i as Integer
      l as Long    ' or whatever
  End Type
  Declare Sub MyDllFunction Lib "MyDll.Dll" (ArrayName As MyType)
  .
  .
  .

  Dim MyArray(1 To 10) As MyType

  Call MyDllFunction(MyArray(1))

-Andy Cook.



Fri, 10 Apr 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing structures/user defined types to DLL's

2. Passing Array or a user defined data type as a parameter to a storedprocedure in Oracle

3. Passing an array of user-defined data type to a class module

4. VB5 passing arguements, user defined types and arrays

5. Passing Arrays and User-Defined Types to Procedures

6. Passing Array or a user defined data type as a parameter to a storedprocedure in Oracle

7. Passing a User-defined type with array

8. Passing user defined type structure to DLL, How?

9. Pass User Defined Type to an ActiveX Dll

10. Bug VB5 Dll: Passing and Returning User-Defined Types

11. pass user-defined type from dll

12. Passing a user-defined type to a DLL routine

 

 
Powered by phpBB® Forum Software