Results 1 to 21 of 21

Thread: Calculation program

  1. #1

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Arrow Calculation program

    How long would a Win32 calculation program take? I mean, with no modification on the GUI other than the normal window style and a few textboxes and drop down menus for which you could choose the conversion.

    And a few menus...

    I was wondering why is it sooo hard and frustrating to create a working app in C++ than in VB..

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986

    Re: Calculation program

    Originally posted by prog_tom

    I was wondering why is it sooo hard and frustrating to create a working app in C++ than in VB..
    That's not true... at first it seems a lot harder to create an app, but once you got a hang of it, it will become a second nature For people like parksie/CornedBee etc. it's as easy to create an app in C++ as it is for you in VB.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    The reason why it takes so long is due to the fact that VB was made to do quick windows based applications where as C/C++ was not.

    For me it would take an hour or two to do a program like that. But I would be kind of cheating in a way and I would recomend it to you an others.

    I have 6 files that I have that are like a template for me. One is a main.cpp and a main.h which contain all of headers, defines, etc. and a basic window program already in them so I can just drop them into a project and be up an running in a few seconds. Then I have two other files that have some custom functions that I wrote that I use a lot, like logging, tracing, writing to an edit box, error messages, string functions, etc. Another file I have has examples of functions that are not too common but are handy to have around, like how to loop through a vector or list, how to change the text of a static, how to do a mutex, etc. The final file has examples of all of my VAR and Function naming, function notes, comments, etc so I can keep consistent on each program.

    I keep this files in a safe place and keep track of all the changes I make to them. The files are very handy to have around because it keeps you from having to reinvent the wheel everytime you go to do something.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  4. #4

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    what is the best way to create such programs?

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  5. #5
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    what do you mean

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    Re: Re: Calculation program

    Originally posted by Jop
    That's not true... at first it seems a lot harder to create an app, but once you got a hang of it, it will become a second nature For people like parksie/CornedBee etc. it's as easy to create an app in C++ as it is for you in VB.
    Well, it's been a while, since most of my stuff has been done with a proprietary closed-source graphics library at my old company (I still have a copy, but haven't looked at it for months). And now I'm not on Windows..... *shrug* Need to learn GTK 2 I think
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    If I am to pop out a very quick app I usually use MFC.
    Needed a windows-based app to test my templated matrix code, so I created an MFC dialog app, was done in ~40 minutes.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    OMG, so how did you guys start? And how long did it take you guys before approaching win32? and when you approach win32, which one did you learn first, winapi or mfc?

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  9. #9
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    its not that hard.
    the hardest part for me is positioning

    so i cheat

    go into VB, arrange your form the way you want it, then save it. open the form in notepad, you'll have all of the coordinates, widths etc that you need for all of the controls
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  10. #10

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    Originally posted by nabeels786
    go into VB, arrange your form the way you want it, then save it. open the form in notepad, you'll have all of the coordinates, widths etc that you need for all of the controls [/B]
    I don't get it...

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  11. #11
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    go into VB, and arrange your form like you want...llike text boxes, frames, buttons etc.
    when you open the form in notepad (like form1.frm)

    you'll get'
    Code:
    Begin VB.Form Form1 
       Caption         =   "Form1"
       ClientHeight    =   3195
       ClientLeft      =   60
       ClientTop       =   345
       ClientWidth     =   4680
       LinkTopic       =   "Form1"
       ScaleHeight     =   3195
       ScaleWidth      =   4680
       StartUpPosition =   3  'Windows Default
       Begin VB.CommandButton Command1 
          Caption         =   "Button!"
          Height          =   855
          Left            =   360
          TabIndex        =   1
          Top             =   720
          Width           =   1575
       End
       Begin VB.TextBox Text1 
          Height          =   285
          Left            =   240
          TabIndex        =   0
          Text            =   "This is a textbox"
          Top             =   240
          Width           =   3975
       End
    End
    then you just plug the coord in when you create your controls

    like to create the above textbox

    Code:
    hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "Text1", 
                WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL, 
                240, 240, 3975, 285, hwnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  12. #12

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    how is that cheating?

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  13. #13

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    i see now, you get all those layouts done in VB and sorta import it into C++ code, clever

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  14. #14
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    Originally posted by prog_tom
    i see now, you get all those layouts done in VB and sorta import it into C++ code, clever
    yup saves alot of time
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  15. #15

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    but why would you bother doing that? since you could use the resource editor in VC++ to layout the dialogs.

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  16. #16
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    Originally posted by prog_tom
    but why would you bother doing that? since you could use the resource editor in VC++ to layout the dialogs.
    lol, how? i dont know how to use it, thats the prob

    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  17. #17

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    just #include "resource.h"

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  18. #18
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    that helps, lol.
    i mean with making the forms, wndproc etc. i dont have the time now to learn it so i just use my method
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  19. #19
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    396
    Tom: Maybe you want to look at the sample provided in the MSDN documentation, just type MFCCALC in the index box and there you go!

  20. #20
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I have to admit that I started right away into MFC. That's the reason why I'm so fierce in encouraging people to learn the language and the API first.
    When I started C++ I did so with "Visual C++ 6 Step by Step". There you write a few console apps to demonstrate the basic C++ concepts, from if over loops and pointers to classes. Sad enough that the more advanced of those didn't work.
    Then it briefly covers the API (VERY briefly) and then you start with MFC, writing a single app throughout the book.
    It's not a good way to start programming...

    After that I bought a really good book which sadly is only available in German.

    When I was through that (and it took me a while) I bought The Petzold. With this I had a firm grip on the API.

    My collection is rounded off by an advanced API programming book by Jeffrey Richter and The Prosise (the MFC equivalent to The Petzold).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  21. #21
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    i started with MFC too, i like api more though for some reason..
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

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