Re: How to define Structure like C in VB

From: Veign (NOSPAMinveign_at_veign.com)
Date: 03/01/04


Date: Mon, 1 Mar 2004 13:40:45 -0500

Define the UDT's like

Private Type SubStructure
    uType as String
    ChildName as String
End Type

Private Type MainStructure
    myName as String
    Child as SubStructure
End Type

When doing so make sure the UDT being used in a type definition has already
been declared. Like above, the child type is declared first and then the
main type. This can be used to nest several levels down as in your request.

-- 
Chris Hanscom
MVP (Visual Basic)
http://www.veign.com
Application Design Section
http://www.veign.com/information/application/info_app.html
------
"vbgnr" <vbgnr@programmer.net> wrote in message
news:opr3634edv98omtp@Microsoft...
> hi Mike,
>
> thanks for your reply. here are my further question:
>
> On Mon, 1 Mar 2004 12:03:54 -0000, Mike D Sutton @ Work <EDais@mvps.org>
> wrote:
>
> >> i want to write a snmp trap monitor program with visual basic. the snmp
> >> trap string i read from winsock control is a binary string, i have to
> >> determine information in the snmp message body by analysing the string.
> >> in C, i can define a structure, then copy the data to the structure,
> >> then get each kind of information by access each field in the
> >> structure. how can i do same with visual basic?
> >
> > You'll need to declare a UDT that has the same structure as the
> > structure you're receiving and use RtlMoveMemory()/CopyMemory() to
> > write the data you receive from SNMP into it.  If the structure uses
>
> the lengths of snmp UDP packeks vary according to different trap event,
and
> the structure of it should be hieratical, looks like the following:
>
> snmp package
>    version
>    community name
>    data (variable)
>      type
>      agent ip
>      time stamp
>      trap data (variable)
>         oid
>         string
>           oemid
>           text (variable)
>
> does UDT support such type like this? any idea?
>
> thanks in advance!
>
> vbgnr


Relevant Pages

  • Re: How to define Structure like C in VB
    ... >> trap string i read from winsock control is a binary string, ... >> determine information in the snmp message body by analysing the string. ... does UDT support such type like this? ...
    (microsoft.public.vb.general.discussion)
  • Re: Problem with hexvalue
    ... SNMP has a few base types. ... type "OCTET STRING". ... have the mib file. ... The manager uses the MIB to determine how to format return values. ...
    (comp.protocols.snmp)
  • Re: How to define Structure like C in VB
    ... > i want to write a snmp trap monitor program with visual basic. ... > trap string i read from winsock control is a binary string, ... You'll need to declare a UDT that has the same structure as the structure you're receiving and use RtlMoveMemory/CopyMemoryto ...
    (microsoft.public.vb.general.discussion)
  • ANNOUNCE: NetDecision 3.0 from NetMechanica has been released
    ... NEW: SNMP Agent Simulator ... int FindProcess (string processname) ... array ResolveOID ...
    (comp.protocols.snmp)
  • Re: How to define Structure like C in VB
    ... Public Type RECT ... > i want to write a snmp trap monitor program with visual basic. ... > trap string i read from winsock control is a binary string, ...
    (microsoft.public.vb.general.discussion)

Loading