Results 1 to 7 of 7

Thread: [RESOLVED] Question about C structure

Threaded View

  1. #1

    Thread Starter
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Resolved [RESOLVED] Question about C structure

    Ok, to start... I am very unfamiliar with c and c++. I have a simple app written in C and I am trying to convert it to vb.net. I am just wondering about a structure that is in the file. this is the structure.
    Code:
    struct Packet {
    	int size;
    	int (*realFunc)(void *, void *, void *, unsigned char *, int, void *);
    	unsigned int repeat;
    	unsigned char buf[2048];
    };
    I can convert it for the most part, but that function (if that is what it is) confuses me.

    This is what I have so far
    Code:
        Private Structure Packet
            Dim size As Integer
    
            Public Function realFunc(ByVal val1 As Object, ByVal val2 As Object, _
                ByVal val3 As Object, ByVal SomeByte As Byte, ByVal Size As Integer, _
                ByVal val4 As Object) As Integer
    
                'I defined them as just objects for lack 
                'of an understanding of what they are
            End Function
    
            Dim Repeat As UInt32
            Dim buf() As Byte
        End Structure
    What I am wondering about is the realFunc variable. Is this a function within a structure? also what does void * mean. I was under the assumption tha void was similar to declaring a sub in vb so, this really confuses me. Thanks to anyone that can help

    B
    Last edited by bmahler; Jul 19th, 2007 at 07:56 AM.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

Posting Permissions

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



Click Here to Expand Forum to Full Width