C Structs I/O 
Author Message
 C Structs I/O

Hello Andrew,

VB doesn't support the same syntax for structures that C does.  VB calls
structures User Defined Types.  For example, if you have the following
struct defined in C:

typedef struct fred
{
    int x;
    int y;
    int cx;
    int cy;

Quote:
} FRED;

You would have to define that as a type in VB like so:

Type Fred
    x as Long
    y as Long
    cx as Long
    cy as  Long
End Type

You could then create variables based on Fred using the VB syntax:

Dim myFred as Fred

And fill its members similar to the way you do in C:

myFred.x = 222
myFred.y = 333
myFred.cx = 100
myFred.cy = 200

I hope this helps,

Larry Tubbs, MCPS, MCSD
Silverleaf Vacation Club

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



Quote:
> Can someone please give me a hand with utilizing
> C structs in VBA (specifically VBA for Office 95)

> I would like to read/write struct's from a file from
> within MS Access 95.  I'm new to programming
> in VBA.

> Thanks very much!

> Andrew Delic



Sun, 04 Jul 1999 03:00:00 GMT  
 C Structs I/O

Can someone please give me a hand with utilizing
C structs in VBA (specifically VBA for Office 95)

I would like to read/write struct's from a file from
within MS Access 95.  I'm new to programming
in VBA.

Thanks very much!

Andrew Delic



Sun, 04 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Diff between Pocket PC OS / Handled PC OS/ Embedded NT OS

2. Howto use a Struct in drag and drop (struct to array-function)

3. English OS to Japanese OS

4. Another CS-Realizer question

5. good VB website(s) for high school CS teacher??

6. CS-RCS with VB6

7. ANNOUNCE: CS-RCS Version 1.2

8. Announce: CS-RCS Version 1.1

9. dumping table structs

10. Passing structs as arguments from VB to C

11. Struct in ArrayList not passing as parameter

12. Help with structs in .NET

 

 
Powered by phpBB® Forum Software