Results 1 to 2 of 2
  1. #1
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Representing a C structure in VB (VBA6)

    I can't seem to find a quick reference for this on the web. I have this structure in C and I need to represent it in VB. I've indicated my area of uncertainty with ??.

    <table border=1 bordercolor=black cellspacing=0 cellpadding=5><td width=60%>Original Documentation (Sanitized)</td><td width=40%>VB Version</td><tr><td>typedef struct_MYSTRUCT
    {
    DWORD dwSize; // size of structure
    DWORD dwParam1; // parameter for the function
    struct
    {
    char szDATA[13] // default data fields
    } Field[7];
    DWORD dwReserved;
    } MYSTRUCT, FAR * LPMYSTRUCT;</td><td>Type MYSTRUCT

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Representing a C structure in VB (VBA6)

    You've got me pushing cobwebs out of the way here Jefferson, but I'd "translate" this pretty much the way you've done - a type containing, among other things, an array of 7 of another type. The char array (the "nested" type) could probably be best represented using the builtin string type - I don't know if the fixed length of 13 plays any part in the use of the STRUCT though, in its C context.

    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •