Does anyone know how to implement UNIONS in VB types 
Author Message
 Does anyone know how to implement UNIONS in VB types

Does anyone know how to implement UNIONS in VB types?
For example i am trying to convert the structure below.

Thanks

William

http://www.*-*-*.com/

typedef struct _CACHE_ENTRY_INFO

DWORD dwStructSize;
LPSTR lpszSourceUrlName;
LPSTR lpszLocalFileName;
DWORD CacheEntryType;
DWORD dwUseCount;
DWORD dwHitRate;
DWORD dwSizeLow;
DWORD dwSizeHigh;
FILETIME LastModifiedTime;
FILETIME ExpireTime;
FILETIME LastAccessTime;
FILETIME LastSyncTime;
LPBYTE lpHeaderInfo;
DWORD dwHeaderInfoSize;
LPSTR lpszFileExtension;
union (DWORD dwReserved; DWORD dwExemptDelta;)

Quote:
} INTERNET_CACHE_ENTRY_INFO, *LPINTERNET_CACHE_ENTRY_INFO;



Fri, 22 Dec 2000 03:00:00 GMT  
 Does anyone know how to implement UNIONS in VB types

Just use the largest member of the union as the type. Sometimes this can be
pretty simple, as in this case being that both members are DWORD's, or
Long's in VB, but with odd unions it may be easier to define separate types
for each possible union.

    union (DWORD dwReserved; DWORD dwExemptDelta;)
becomes:
    dwReserved_Or_dwExemptDelta as Long

--
Jeremy - my reply address is foiled

Quote:

>Does anyone know how to implement UNIONS in VB types?
>For example i am trying to convert the structure below.

>Thanks

>William

>http://www.wilba.demon.co.uk

>typedef struct _CACHE_ENTRY_INFO

>DWORD dwStructSize;
>LPSTR lpszSourceUrlName;
>LPSTR lpszLocalFileName;
>DWORD CacheEntryType;
>DWORD dwUseCount;
>DWORD dwHitRate;
>DWORD dwSizeLow;
>DWORD dwSizeHigh;
>FILETIME LastModifiedTime;
>FILETIME ExpireTime;
>FILETIME LastAccessTime;
>FILETIME LastSyncTime;
>LPBYTE lpHeaderInfo;
>DWORD dwHeaderInfoSize;
>LPSTR lpszFileExtension;
>union (DWORD dwReserved; DWORD dwExemptDelta;)
>} INTERNET_CACHE_ENTRY_INFO, *LPINTERNET_CACHE_ENTRY_INFO;



Fri, 22 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Anyone know how to implement panes in VB?

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

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

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

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

6. Does anyone know how to register a file type in vb 4.0

7. anyone know how i would implement using a scanner into visual basic,

8. AnyOne knows How It can Be Done?

9. AnyOne knows How It can Be Done?

10. DeleteFile Type Library - Does anyone know?

11. Union Data type in VB??

12. Passing of C language's union data type in VB application

 

 
Powered by phpBB® Forum Software