Re: How to define Structure like C in VB
From: Veign (NOSPAMinveign_at_veign.com)
Date: 03/01/04
- Next message: Vikram Lele: "Re: How to define Structure like C in VB"
- Previous message: vbgnr: "Re: How to define Structure like C in VB"
- In reply to: vbgnr: "Re: How to define Structure like C in VB"
- Next in thread: Mike D Sutton: "Re: How to define Structure like C in VB"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Vikram Lele: "Re: How to define Structure like C in VB"
- Previous message: vbgnr: "Re: How to define Structure like C in VB"
- In reply to: vbgnr: "Re: How to define Structure like C in VB"
- Next in thread: Mike D Sutton: "Re: How to define Structure like C in VB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading