Announcement

Collapse
No announcement yet.

PB FOR WINDOWS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PB FOR WINDOWS

    After buying "WIN32 PROGRAMMING", "WINDOWS 98 PROGRAMMING BIBLE",
    and trying to use there code for neat routines like "KEYEXPRESS",
    which reads keypresses without a menu, I am going crazy trying to
    read C and C++ which I know nothing about to work with PBDLL60.
    I thought that was why I bought PBDLL60, what a mistake. I have
    to much to do converting PB3.5 to PBCC without dreaming about
    using PBDLL60. When and if POWERBASIC can create a windows type
    language that will convert C or C++, let me know.

    Brent

    ------------------

  • #2
    Yawn...

    When you see an ad which says "PB Converts C/C++ to basic" let me know because I've never read that.

    If you know anything about windows programming then you'll know that even if you use MFC, VCL or ActiveX to simplify the process you're a;ways better off understanding how widows really works. Yes, you can program windows easier, and in PBDLL6 that would be to use DDT (and maybe something like easyGUI) or powerGen if you prefer SDK programing (which seems not to be the case)

    so, do you have a question or is this just a general sort of whinge? If your question is just "When and if POWERBASIC can create a windows type language that will convert C or C++, let me know" you may as well go back to working in a convenience store or fast food chain because it's not going to happen.



    ------------------
    Paul Dwyer
    Network Engineer
    Aussie in Tokyo

    Comment


    • #3

      Brent,

      Personally I find your comments of PB/DLL quite harsh, yeah -
      its not the easiest language to learn, but nor is any win32-based language, I mean if you want easy then Visual Basic is your answer! It took me many months of trial & error to learn what I know about the Windows API, but in the end it is worth it to gain a better understanding of the OS.

      Even though I've got Visual Basic, I never use it now. I prefer speed & size over BloatWare.

      Rgds,

      ------------------
      Kev G Peel
      KGP Software, Bridgwater, UK.
      http://www.kgpsoftware.com
      kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

      Comment


      • #4
        Brent,

        First, buy EzGui. Chris Boss has made the transition from Dos to WinBlows a lot easier. I know, I'm just going through it. Eventually we'll all end up dealing with the API, but Chris gives you a big leg up. He's coming out with 2.0 in a week or two & I've been beta testing. It has keyboard hooks and other neat stuff.

        Second, keep reading these forums & Ezgui forums. I've learned a lot.

        Third, knuckle down, hold your nose & start the process. There's no other good way out. I'm with Kev. VB was easier to work with when I was investigating window programming, but I didn't get too far before I realized it wasn't going to cut it. The new VB.Net is going to be a lot worse.

        Good luck!

        ------------------
        "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

        Comment


        • #5
          Brent:

          I strongly second Russ' comments. After experiencing a long period of frustration, it was EZGUI that helped me make the transition from DOS to the Win platform. Don't get me wrong, there is a sharp learning curve! It's just that after working on several simple apps, suddenly the light bulb comes on and it starts coming together. Many have made this journey -- so you're not alone. You do just have to knuckle down and do it.

          But above all, EZGUI will make it a lot easier than simply wading through the C++ books and trying to understand what's going on.

          Best of luck!

          Frank

          ------------------

          Comment


          • #6
            Brent,

            I tend to agree with both Paul and Kev here, in my own case I had some
            megabytes of very good DOS assembler that died in the transition from
            DOS to win32.

            PowerBASIC did not write Windows, Microsoft did and it was always a C
            based operating system. I learnt API coding in C with the SDK for win3.0
            and it was genuinely hard going but once you get the swing of it, it
            sinks in.

            Learning the basic architecture of the operating system is fundamental
            to writing small and fast windows code and I sugest to you that PowerBASIC
            PBCC and PBDLL are among the cleanest and fastest way of doing this.

            There are numerous aftermarket vendors who can help you in the transition,
            Eric Pearson, Chris Boss, Patrice Terrier and many others if you wish to
            go in that direction but you will still have to make the transition to
            operating system code eventually if you wish to get the most out of win32.

            Regards,

            [email protected]

            ------------------
            hutch at movsd dot com
            The MASM Forum

            www.masm32.com

            Comment


            • #7
              Brent;

              I'll post my reply in the Third Party forum, since it goes into detail
              a bit.

              See the post : "DOS to Windows the EZGUI way"


              [This message has been edited by Chris Boss (edited March 24, 2001).]
              Chris Boss
              Computer Workshop
              Developer of "EZGUI"
              http://cwsof.com
              http://twitter.com/EZGUIProGuy

              Comment


              • #8
                Brent,

                One more thing: Don't dive into your most important project
                right off the bat! Do a lot of practice programs. Test concepts,
                try out things that will have to work in the windows way, even
                if you'd rather not do that. Make some utilities, maybe a
                program that converts syntax from PBDOS to PB windows (there are
                some differences). Not only will you learn some things you need
                to learn, but you'll end up with something usefull. My big
                Dos applications were written in PDQ, so I did a PDQ to PBDLL
                converter. Also learn about creating DLLs. It's really easy
                with PBDLL and you're going to need to use them.

                And it's OK to curse Bill Gates now and then. It won't change anything
                , but it feels good.

                Russ Srole

                ------------------
                "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

                Comment


                • #9
                  Maybe its just me, but I found that trying to learn to program
                  Windows with PB/DLL by using C / C++ examples was a waste of time.

                  Much better to just try learning how to start doing simple things
                  directly with PB/DLL by playing with the cornucopia of sample code
                  available here.



                  ------------------
                  Bernard Ertl
                  Bernard Ertl
                  InterPlan Systems

                  Comment


                  • #10
                    I just bought a book that looks really promising for this transition; Visual Basic Programmer's Guide to the Win32 API by Dan Appleman (ISBN 0-672-31590-4). Even though we're all using PB this book is formated for Dos to Win tranitions and Basic syntax and calling conventions. I'm just getting into it, but so far it is well written.

                    One of my proglems with the API is that most other books (and I have several) are C oriented. I can read that stuff, but it requires too much time and concentration to translate it to my perferred language, so it's easy to get lost.
                    Russ Srole

                    ------------------
                    "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

                    Comment


                    • #11
                      I've got that book, which is good for some descriptions but recently I've found that getting used to the MSDN web format has been very worth while. That way you can just got to http://msdn.microsoft.com/ and type the API call name in the search window, click the link and read it. There is also a lot of info on effects of different OS's and whether it's out of date etc.



                      ------------------
                      Paul Dwyer
                      Network Engineer
                      Aussie in Tokyo

                      Comment


                      • #12
                        Russ,

                        Probably the simplest key to translating Microsoft C reference material to
                        PowerBASIC is understanding the data types. One of the few blessings in API
                        code is that almost all data types are 32 bits in length and this simplifies
                        translation from C to PowerBASIC by a lot.

                        PowerBASIC uses two normal data types for 32 bit integers, LONG and DWORD being
                        signed and unsigned. An approach that will get you out of trouble most of the
                        time is to use LONG integers as parameters and return values.

                        LRESULT SendMessage(
                        HWND hWnd, // handle of destination window
                        UINT Msg, // message to send
                        WPARAM wParam, // first message parameter
                        LPARAM lParam // second message parameter
                        );

                        This translates to,

                        LOCAL retval as LONG
                        LOCAL hWnd as LONG
                        LOCAL Msg as LONG
                        LOCAL wParam as LONG
                        LOCAL lParam as LONG

                        ' Set the values you need in code.

                        retval = SendMessage(hWnd,Msg,wParam,lParam)

                        It is usually code much simpler again,

                        retval = SendMessage(hWnd,%WM_SETTEXT,0,ByCopy(MyText$))

                        Many windows API calls work with structures (basic UDT) but PowerBASIC
                        handles this easily enough.

                        BOOL GetClientRect(
                        HWND hWnd, // handle of window
                        LPRECT lpRect // address of structure for client coordinates
                        );

                        This translates to,

                        LOCAL Rct as RECT

                        GetClientRect hWnd,ByVal VarPtr(Rct)

                        or usually,

                        GetClientRect hWnd, Rct

                        The results are in the "Rct" structure members.

                        PowerBASIC is a bit smarter than C in the way it passes parameters to
                        functions and subs. You have the choice of passing information by value
                        (ByVal), by its address in memory (ByRef) or pass a copy of data (ByCopy).

                        If you approach the API functions from a PowerBASIC perspective, they tend
                        to come a lot easier and you will find that PowerBASIC can handle them
                        fine.

                        Regards,

                        [email protected]

                        ------------------
                        hutch at movsd dot com
                        The MASM Forum

                        www.masm32.com

                        Comment


                        • #13
                          Steve,

                          Thanks for the outlook, if you'll pardon the pun. That does simplify
                          the thought process. What I realy hope to get out of the book is
                          more then just function call formats, since the win32api.inc has
                          that already, but how one glues a lot of the api commands together
                          to make your software do great things. A lot of you guys have been
                          programming windows for a good long time and this stuff no longer seems
                          like such a mystery. A good example is Semens drag and drop demo
                          where he moves an icon around the screen at will. Even reading the
                          test code doesn't tell me what's really going on there. So a good
                          book with examples is a help. So is the PB forum and for me the
                          Ezgui forum. I understand Brents frustrations, but I think if he
                          toughs it out in 6 or 7 months he'll feel a lot more comfortable with
                          PB and windows.

                          Russ Srole


                          ------------------
                          "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

                          Comment


                          • #14
                            Russ,

                            I have a pretty good idea where you are coming from as I had to do it myself
                            a long time ago. The most important thing in approaching windows software is
                            to get the swing of the fundamental architecture. For all of the hype about
                            OOP, VB, Delphi etc ... Windows is a message driven windowing system.

                            Every window has its own message processing function, a CreateWindowEx style
                            normal window has a WndProc style message handler, a dialog has a Dialog
                            style message handler and controls can access the message procs that they
                            have through what is called a subclass function that intercepts the messages
                            and passes them on to the default message handler.

                            The thing in common with all window types is that they have a corresponding
                            message handling procedure. Messaging is conceptually a means of telling a
                            window to do something. There are a range of default messages sent to a
                            window by the operating system which the programmr can modify, process or
                            just plain throw away.

                            The format used in the API call SendMessage() of hWnd, Message, wParam,
                            lParam is one you will find in the message handling function that you write
                            in Windows.

                            Dan Appleman's book should be of use to you but if you can still find one,
                            Charles Petzold's books have much more meat in them and the example code has
                            been translated to PowerBASIC and is available on the PB website.

                            If the aftermarket vendors are useful to you, thats fine, ther are some very
                            good programmers among them and most of them go out of their way to help
                            their customers but eventually you will start writing API style code as it
                            is where the performance is.

                            When you get around to it, here is the URL where I post some of my own working
                            tools for PowerBASIC programmers,
                            http://www.pbq.com.au/home/hutch/pbdll50.htm

                            These code generating tools are freeware for PowerBASIC programmers and help to
                            take a lot of the hack work out of writing true API code.

                            Regards,

                            [email protected]

                            ------------------
                            hutch at movsd dot com
                            The MASM Forum

                            www.masm32.com

                            Comment


                            • #15
                              Steve,

                              Actually I bookmarked you website 6 months ago! Those are good tools.
                              I think we may have lost Brent in this discussion. Oh, well.

                              Best Regards,
                              Russ Srole

                              ------------------
                              "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

                              Comment

                              Working...
                              X