CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Source Code

  1. #1
    Join Date
    Aug 2000
    Posts
    265

    Source Code

    Is there a way to view the source code VB generates for me when developing my VB Application?



  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Source Code

    May be I did not understand the question, but the source code is exactly the code you are writing in your forms and modules. If you want to see your executable, you can do it any hex editor and find the hex code of your compiled app.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Aug 2000
    Posts
    265

    Re: Source Code

    I'm looking for all of the behind-the-scenes code for the controls, etc.


  4. #4
    Join Date
    Apr 2000
    Posts
    737

    Re: Source Code

    I don't think you can get an vb code from the controls, as some of them are not programmed in vb, but if you know assembly, then you can compile the program and run it in visual C++, which all you to view the assembly code. Sometime, I do use this method to find out how VB perform some function.

    HTH

    cksiow
    http://vblib.virtualave.net - share our codes


  5. #5
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Source Code

    I think he means he wants the code to align the create the controls, load them, align them, initialize etc.
    In C you will have to do that yourself, in VB it is done for you. The only 'readable' place you can find this is in the .frm file.
    Try it, rename a form to txt, open it in notepad, and tada, all your controls, initial values etc.
    I use this technique to easely copy a form. Make a copy in explorer, edit it, change the name property and a bit further down the vb_attribute name and you can load the form in your project.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  6. #6
    Join Date
    Aug 2000
    Posts
    265

    Re: Source Code

    What language is it written in? I don't know what the Begin blocks are doing and the attribute statement. Do you know?


  7. #7
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Source Code

    I don't know what language it is, if it even is one.
    The begin/end blocks define an object, one you will always have in a form is the
    Begin VB.Form formName
    This defines an object of the type Form, located in the class VB. If you've ever worked with com, you should notice the dll.component notation.
    Actually, now i'm looking at it, this ain't so hard.
    You begin an object, everything that follows are properties of that object. You should see the caption, borderstyle ect.
    If the object can contain objects itself (read as controls on a form, or picturebox or whatever can serve as a container), there can be other Begin/end block withing the first.
    After all the objects (so the form is completely built) come the attributes.
    The Attributes are extra information used by the VB compiler.
    After the attributes, the code follows, this is the part you can actually see in your codepane.

    If you open a project file in notepad, you will see some other stuff, but it's quite readable, except for the objects (used components) and the refferences, which are displayed as their GUID.


    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  8. #8
    Join Date
    Aug 2000
    Posts
    265

    Re: Source Code

    Great. Thanks so very much!


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

Featured