1. WIN32LIB
- Posted by David Alan Gay <moggie at INTERLOG.COM> Aug 12, 2000
- 518 views
Greetings To put the Drake Ice Smackdown to rest, I want to start a thread that is related to Euphoria again. I'm excited that WIN32LIB is now greatly supported and enhanced by many programmers. This ensures a promising future as bright as Euphoria's own. However, one thing that I feel is very important but has not been discussed here is keeping WIN32LIB in line with Euphoria's own goal...to keep it simple and easy to use (or to ensure we say "No" to complex programming languages). If we enhance WIN32LIB to the point of being a battleship, it;s going to become something only the most seasoned programmer will be able to master. More junior programmers may be discouraged from using it and stick to text graphics in a Windows console screen if it becomes too difficult to use. Expanding the point further is a need to enhance the documentation to WIN32LIB in the same zeal as enhancing WIN32LIB itself. I know writing documentation for a program is not as exciting as writing the program itself. I personally find it dull....I hate writing documentation at work as a programmer, and only do it because my boss tells me to :>....While I think wolfgang has done a great job with his tutorial on WIN32LIB, and thank David Cuny for enclosing the demo programs with WIN32LIB (particularly GENERIC.EW, which I raid constantly for experimentation), a full blown tutorial in the same realm of ABGTE is overdue...to explain not just how to use WIN32LIB, but to give a general overview of the concepts of Windows programming using WIN32LIB. For example, it took me a while to figure out what was meant by controls, parent and child windows, and focus. I finally understood what they were only by experimenting with pieces of the demo programs...sometimes with interesting results (like a reboot or colour inverted screen) Please do not consider this a slam of WIN32LIB: I am trying to get WIN32LIB to work for me because it is the first toolkit that has managed to open Windows programming up for me and make it easier. I offer my suggestions because I support it wholeheartedly and want other programmers new to Windows programming to discover what I have about WIN32LIB. Thanks David
2. Re: WIN32LIB
- Posted by John Coonrod <jc at THP.ORG> Aug 12, 2000
- 457 views
I second David's message about keeping win32lib as simple as possible, and doing great documentation. I would be very happy to assist. For example, I discovered on my own that one could create a sequence of controls - it may be in the documents somewhere, but it is certainly critical for a lot of programming needs. I'm an old-school, assembly-language programmer (I've written a number of compilers and real-time systems) who has also avoided windows programming like the devil until I came upon Euphoria. Now I'm happy. I actually have been impressed with the overall Euphoria documentation, and suggest we keep our efforts in a similar layout design philosophy. A good philosophy might be to keep in mind HTML. HTML is actually the most widely used windows programming environment in the world, and many people are now familiar with its constructs. So it might be useful to aim our educational efforts at people who have some familiarity with HTML. Does anyone have a suggestion for a place to start? Would a good "introduction to basic concepts of windows programming" be the appropriate place to start?
3. Re: WIN32LIB
- Posted by David Alan Gay <moggie at INTERLOG.COM> Aug 12, 2000
- 465 views
> Does anyone have a suggestion for a place to start? Would a good > "introduction to basic concepts of windows programming" be the appropriate > place to start? > That's the best place to start, John. Everything that WIN32LIB uses to function...controls, parent-child window relationships, events...is derived from the Windows environment. What would be best for starters is a comparison between DOS programming (which everyone here has done and has control programming control over) and Windows programming (which a few have done and rely on Windows API to meet their requests). I can already give you one difference from my own experiences: DOS programs have a mainline you can control, and are procedure-driven...Windows programs have no definable mainline and are dependent on triggered events. It should not be done in the manner Charles Petzold of Windows 95 programming fame had done (with all due respect and apologies to his fans here in the group). Charles put too much time explaining how to do it using a specific language and very little time explaining the "why". He didn't explain how the Windows environment actually worked and what all of the parts were. He just basically said "register this window, and do it using Visual C++ and you will do fine!". It's like saying to a budding sailboater, "Just unfurl the sail and go" without explaining about the dynamics of sailboating, the parts of a sailboat, and the tricks and dangers of sailboating. David Gay
4. Re: WIN32LIB
- Posted by Bernie <xotron at PCOM.NET> Aug 12, 2000
- 444 views
On Sat, 12 Aug 2000 11:58:47 -0400, David Alan Gay <moggie at INTERLOG.COM> wrote: >> Does anyone have a suggestion for a place to start? Would a good >> "introduction to basic concepts of windows programming" be the appropriate >> place to start? David I think that you are going to run in to problems trying to explain basic concepts of windows programming using win32lib. win32lib whole idea and concept is to hide the details of windows programming and make window programming easier.
5. Re: WIN32LIB
- Posted by John Coonrod <jc at THP.ORG> Aug 12, 2000
- 456 views
Right. The idea is not to USE win32lib to explain the principles, but rather to explain the principles in a way that people can feel comfortable using win32lib. - John Coonrod ===== Original Message from Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> at 8/12/00 2:01 pm >On Sat, 12 Aug 2000 11:58:47 -0400, David Alan Gay <moggie at INTERLOG.COM> >wrote: > >>> Does anyone have a suggestion for a place to start? Would a good >>> "introduction to basic concepts of windows programming" be the >appropriate >>> place to start? > > David > > I think that you are going to run in to problems trying to explain > > basic concepts of windows programming using win32lib. > > win32lib whole idea and concept is to hide the details of windows > > programming and make window programming easier.
6. Re: WIN32LIB
- Posted by David Cuny <dcuny at LANSET.COM> Aug 12, 2000
- 516 views
Bernie wrote: > I think that you are going to run in to problems trying to explain > basic concepts of windows programming using win32lib. > win32lib whole idea and concept is to hide the details of windows > programming and make window programming easier. I agree. I think that, to a large extent, the best way to learn Win32Lib is to go through the examples, starting with EX01 and continuing. It attempts to introduce the concepts one at a time. EX01 creates an empty window; EX02 creates a window with a button; EX03 attaches code to the window, and so on. On the other hand, it really helps to understand what's going on (and to grasp the code in the library) if you know something about how Windows works. I think there are (roughly) three different classes of users: 1. The 'newbie' who wants to write a Windows application, and doesn't care how Windows works. They need a tutorial on how to use the library; and that library has already been written. There's also a brief explanation of most of the functions buried in the middle of Win32Lib.doc. 2. The 'power' Win32Lib user, who wants to access some of the 'advanced' features in Win32Lib (flags, etc.). This requires that they work directly with the Win32 API. This isn't a difficult thing to do, but you have to understand how the Windows event loop works, how to hook things into Win32Lib, how to read C documentation, and how to convert that into Win32Lib terms. Not impossible, but it requires a fairly good knowledge of Windows programming. 3. The Win32Lib library writer, who wants to add to the functionality of Win32Lib. There's a bit of a writeup at the end of Win32Lib.doc, but it's way out of date. Since Win32Lib development is moving away from me, I should probably spend most of my documentation efforts of #3, explaining how Win32Lib works 'under the hood', to make it easier for coders to go in and add new features, track bugs, and so on. As for #1, I think the sad truth is that you just have to go in and play with the library, and decide what parts of it you need. There's no magical wand; you just have to find out what objects and routines are there, and play with them. Some things, like double buffering, sprites, and so on, could be written up much better than they are. But it's not really that hard to get Win32Lib up and running, even for a newbie. To get to #2 or #3, you need a some Windows specific knowledge. There are a lot of good tutorials and books out there, and I think they explain things better than I could. Just be sure to stay away from those that work with C++ or MFC, and you'll be fine. Once you understand how Windows works, it's not that hard to figure out how to apply certain function flags, and so on. Win32Lib is fairly transparent; most of the routines you can just look at, consult the Win32.hlp file, and figure out what is going on. Internally, the code is well documented as to what it's doing, and why. Exending Win32Lib, once you know the basics of Windows coding, it not really that hard - just tedious! For example, take Judith's request to extend getPrinter to include paper orientation (landscape/portrait). If you take a look at the routine, you can see that it allocates a PRINTDLG structure, fills in some values, and calls the Win32 API function PrintDlg. Popping open Win32.hlp and looking up PrintDlg, you can see that none of the options include paper orientation. But the link to the DEVMODE structure shows that there is a dmOrientation field, which probably controls the paper orientation. From there, it's all grunt work. The real trick is figuring out how to incorporate the changes so that they work sensibly with Win32Lib, and not cause the application to eventually bloat and become a maze of function calls. -- David Cuny
7. Re: WIN32LIB
- Posted by John Coonrod <jc at THP.ORG> Aug 12, 2000
- 465 views
David - As you know, I'n a big fan of what you've done with win32lib. However, I know for myself I would have saved a lot of time if I'd had a few concepts under my belt before trying to create my own application. Most 'newbies' are probably wanting to build a 'real' application with a lot of specific functionality, to solve a real problem. They need to know how to solve their problem - which means they need to know how to think in this framework, which means they need to know principles. For example, I was inclined to use wPuts instead of using LText controls. After much playing, I learned that this required me to create my own onPaint routine, which I would not have needed with the LText controls. It's kind of a pegagogical problem. Going through lots of examples does not necessarily give people access to the principles they need to solve their own problems. - John Coonrod ===== Original Message from Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> at 8/12/00 > >1. The 'newbie' who wants to write a Windows application, and doesn't care >how Windows works. They need a tutorial on how to use the library; and that >library has already been written. There's also a brief explanation of most >of the functions buried in the middle of Win32Lib.doc.
8. Re: WIN32LIB
- Posted by Ben Fosberg <BenFosberg at ATT.NET> Aug 12, 2000
- 461 views
Speaking as one of the "newbies" to both Euphoria and Windows programming, I find myself agreeing with both David and John. One one hand, it would be nice to have some more background and general principals to help put all this stuff together, and on the other, it seems to me that the basic problem to be dealt with is Windows itself, which is very large and extremely complex - I read somewhere recently that there are over 17,000 "calls" in the API. There's just a massive amount of detail to be digested, and it seems one's only hope is to concentrate on the Windows stuff that appears to relate to a specific task, and ask around when you "hit" a snag. Once one gets beyond the very basic, and somewhat abstract, things like the event loop and messaging, things seem to very rapidly become highly specific and profusely detailed. Which is why, I presume, most of the books seem to run over 1200 pages, and none seem very complete. I will be grateful for any efforts made to explain the workings of Windows, if for no other reason than I often find that an explanation that's clear and obvious to one person is completely meaningless to another. ("Intuitive" is one of the most fallacious concepts in programming.) But I suspect that there's no clear and straightforward way to explain a "system" that's so messy. One just has to take the time to plow through lots of documentation and lots of examples. A much less ambitious project I'm considering is recasting David's documentation into a form that would be a little more accessible to my editor's online help system. The editor seems to do fine at providing "context-sensitive" help using RDS's help files but not so well with the win32lib document. Anyone have any suggestions/requests on that score? David Cuny wrote: > Bernie wrote: > > > I think that you are going to run in to problems trying to explain > > basic concepts of windows programming using win32lib. > > win32lib whole idea and concept is to hide the details of windows > > programming and make window programming easier. > > I agree. > > I think that, to a large extent, the best way to learn Win32Lib is to go > through the examples, starting with EX01 and continuing. It attempts to > introduce the concepts one at a time. EX01 creates an empty window; EX02 > creates a window with a button; EX03 attaches code to the window, and so on. > > On the other hand, it really helps to understand what's going on (and to > grasp the code in the library) if you know something about how Windows > works. I think there are (roughly) three different classes of users: > > 1. The 'newbie' who wants to write a Windows application, and doesn't care > how Windows works. They need a tutorial on how to use the library; and that > library has already been written. There's also a brief explanation of most > of the functions buried in the middle of Win32Lib.doc. > > 2. The 'power' Win32Lib user, who wants to access some of the 'advanced' > features in Win32Lib (flags, etc.). This requires that they work directly > with the Win32 API. This isn't a difficult thing to do, but you have to > understand how the Windows event loop works, how to hook things into > Win32Lib, how to read C documentation, and how to convert that into Win32Lib > terms. Not impossible, but it requires a fairly good knowledge of Windows > programming. > > 3. The Win32Lib library writer, who wants to add to the functionality of > Win32Lib. There's a bit of a writeup at the end of Win32Lib.doc, but it's > way out of date. > > Since Win32Lib development is moving away from me, I should probably spend > most of my documentation efforts of #3, explaining how Win32Lib works 'under > the hood', to make it easier for coders to go in and add new features, track > bugs, and so on. > > As for #1, I think the sad truth is that you just have to go in and play > with the library, and decide what parts of it you need. There's no magical > wand; you just have to find out what objects and routines are there, and > play with them. Some things, like double buffering, sprites, and so on, > could be written up much better than they are. But it's not really that hard > to get Win32Lib up and running, even for a newbie. > > To get to #2 or #3, you need a some Windows specific knowledge. There are a > lot of good tutorials and books out there, and I think they explain things > better than I could. Just be sure to stay away from those that work with C++ > or MFC, and you'll be fine. Once you understand how Windows works, it's not > that hard to figure out how to apply certain function flags, and so on. > > Win32Lib is fairly transparent; most of the routines you can just look at, > consult the Win32.hlp file, and figure out what is going on. Internally, the > code is well documented as to what it's doing, and why. Exending Win32Lib, > once you know the basics of Windows coding, it not really that hard - just > tedious! > > For example, take Judith's request to extend getPrinter to include paper > orientation (landscape/portrait). If you take a look at the routine, you can > see that it allocates a PRINTDLG structure, fills in some values, and calls > the Win32 API function PrintDlg. Popping open Win32.hlp and looking up > PrintDlg, you can see that none of the options include paper orientation. > But the link to the DEVMODE structure shows that there is a dmOrientation > field, which probably controls the paper orientation. From there, it's all > grunt work. The real trick is figuring out how to incorporate the changes so > that they work sensibly with Win32Lib, and not cause the application to > eventually bloat and become a maze of function calls. > > -- David Cuny
9. Re: WIN32LIB
- Posted by Bernie <xotron at PCOM.NET> Aug 12, 2000
- 458 views
On Sat, 12 Aug 2000 15:16:25 -0500, Ben Fosberg <BenFosberg at ATT.NET> wrote: nice to >have some more background and general principals to help put all this stuff >together, and on the other, it seems to me that the basic problem to be >dealt >with is Windows itself, which is very large and extremely complex - I read >somewhere recently that there are over 17,000 "calls" in the API. There's It may be some help for you to look at my w32api20.zip in the archive. Bernie
10. Re: WIN32LIB
- Posted by Ben Fosberg <BenFosberg at ATT.NET> Aug 12, 2000
- 473 views
Thanks, Bernie - I have done that and am working my way thru it as time permits. It is indeed very useful both in itself, and - as you indicated - in helping me understand documentation, written for C programmers. Bernie wrote: > On Sat, 12 Aug 2000 15:16:25 -0500, Ben Fosberg <BenFosberg at ATT.NET> wrote: > nice to > > >have some more background and general principals to help put all this stuff > >together, and on the other, it seems to me that the basic problem to be > >dealt > >with is Windows itself, which is very large and extremely complex - I read > >somewhere recently that there are over 17,000 "calls" in the API. There's > > It may be some help for you to look at my w32api20.zip in the > > archive. > > Bernie
11. Re: WIN32LIB
- Posted by David Cuny <dcuny at LANSET.COM> Aug 13, 2000
- 484 views
John Coonrod wrote: > Most 'newbies' are probably wanting to build a 'real' application > with a lot of specific functionality, to solve a real problem. They > need to know how to solve their problem - which means they > need to know how to think in this framework, which means they > need to know principles. I agree that you can only go so far with *any* Windows library (including VB) while attempting to maintain complete ignorance to the inner workings of Windows. Working with onPaint is an excellent example. I struggled for a while to do it, and finally gave up. I could have set the Window attribute to have persistant graphics, so you wouldn't need to deal with onPaint, but the memory overhead was just too high. -- David Cuny
12. Re: WIN32LIB
- Posted by Ad Rienks <kwibus at ZONNET.NL> Aug 13, 2000
- 488 views
Gentlemen, What you are discussing here is exactly what I had in mind when I tried to write a "Win32Lib Tutorial". My main goal was also to learn Win32 programming by writing down what I ran into, and what solutions there could be found. After posting a few of these "lessons", Wolfgang Fritz offered to help me, translating things into HTML and putting together a nice user interface. Not too long after that, I discovered that Wolfgang was a better learner than I am, his contributions increased and mine decreased. So now you can call it his project, but he always is trying to encourage people to join in. Maybe this is where you can jump in and write an introduction to Win32 programming, that can become part of the "Tutorial Project". Maybe it could even be incorporated into the recent Win32Lib coding project? Ad Rienks ----- Oorspronkelijk bericht ----- Van: David Alan Gay <moggie at INTERLOG.COM> Aan: <EUPHORIA at LISTSERV.MUOHIO.EDU> Verzonden: zaterdag 12 augustus 2000 17:58 Onderwerp: Re: WIN32LIB > > Does anyone have a suggestion for a place to start? Would a good > > "introduction to basic concepts of windows programming" be the appropriate > > place to start? > > > > That's the best place to start, John. Everything that WIN32LIB uses to > function...controls, parent-child window relationships, events...is derived > from the Windows environment. What would be best for starters is a > comparison between DOS programming (which everyone here has done and has > control programming control over) and Windows programming (which a few have > done and rely on Windows API to meet their requests). I can already give you > one difference from my own experiences: DOS programs have a mainline you can > control, and are procedure-driven...Windows programs have no definable > mainline and are dependent on triggered events. > > It should not be done in the manner Charles Petzold of Windows 95 > programming fame had done (with all due respect and apologies to his fans > here in the group). Charles put too much time explaining how to do it using > a specific language and very little time explaining the "why". He didn't > explain how the Windows environment actually worked and what all of the > parts were. He just basically said "register this window, and do it using > Visual C++ and you will do fine!". It's like saying to a budding sailboater, > "Just unfurl the sail and go" without explaining about the dynamics of > sailboating, the parts of a sailboat, and the tricks and dangers of > sailboating. > > David Gay
13. Re: WIN32LIB
- Posted by Ad Rienks <kwibus at ZONNET.NL> Aug 13, 2000
- 467 views
David, I do not agree totally that Windows programs don't have a main line. I would say the main line are the commands that are executed when you 'open' or 'start' the program. Such as Initialization of variables and the like, loading files, building the first controls. After that, the program goes into a loop, looking for events. Ad > I can already give you > one difference from my own experiences: DOS programs have a mainline you can > control, and are procedure-driven...Windows programs have no definable > mainline and are dependent on triggered events. > David Gay
14. Re: WIN32LIB
- Posted by David Alan Gay <moggie at INTERLOG.COM> Aug 13, 2000
- 459 views
My apologies. The mainline I was making reference to was a conditioned loop that kept the program running, like an exit key not being pressed, or while there was still data in a file to read, or to using a gaming example, while all the asteriods are still floating around waiting to be shot. By the way, has anyone heard from Lord Generic Productions lately? I miss OIDZONE. In DOS, you can easily set any condition in a program mainline to stop the loop. In a WIN32LIB powered Euphoria program, the program only stops when the primary window is closed. David Gay ----- Original Message ----- From: "Ad Rienks" <kwibus at ZONNET.NL> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Sunday, August 13, 2000 8:48 AM Subject: Re: WIN32LIB > David, > > I do not agree totally that Windows programs don't have a main line. I would > say the main line are the commands that are executed when you 'open' or > 'start' the program. Such as Initialization of variables and the like, > loading files, building the first controls. After that, the program goes > into a loop, looking for events. > > Ad > > > I can already give you > > one difference from my own experiences: DOS programs have a mainline you > can > > control, and are procedure-driven...Windows programs have no definable > > mainline and are dependent on triggered events. > > > David Gay >
15. Re: WIN32LIB
- Posted by John Coonrod <jc at THP.ORG> Aug 13, 2000
- 470 views
Ad - where can this be found? - John Coonrod ===== Original Message from Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> at 8/13/00 >What you are discussing here is exactly what I had in mind when I tried to >write a "Win32Lib Tutorial". My main goal was also to learn Win32 >programming by writing down what I ran into, and what solutions there could >be found. After posting a few of these "lessons", Wolfgang Fritz offered to >help me, translating things into HTML and putting together a nice user >interface. >Ad Rienks
16. Re: WIN32LIB
- Posted by John Coonrod <jc at THP.ORG> Aug 13, 2000
- 460 views
I agree entirely with your decision. I think your basic package is a wonderful balance, as I am strongly anti-bloat. So far, I've not found anything I really need that I cannot do without. - John Coonrod ===== Original Message from Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> at 8/13/00 >Windows. Working with onPaint is an excellent example. I struggled for a >while to do it, and finally gave up. I could have set the Window attribute >to have persistant graphics, so you wouldn't need to deal with onPaint, but >the memory overhead was just too high. > >-- David Cuny
17. Re: WIN32LIB
- Posted by Ad Rienks <kwibus at ZONNET.NL> Aug 13, 2000
- 501 views
- Last edited Aug 14, 2000
John, You can find and download the tutorial from Wolfgang's home page: http://www.king.igs.net/~wolfritz/tutor.htm or in the Euphoria Archives, there is also a link to this page. Succes, Ad ----- Oorspronkelijk bericht ----- Van: John Coonrod <jc at THP.ORG> Aan: <EUPHORIA at LISTSERV.MUOHIO.EDU> Verzonden: zondag 13 augustus 2000 16:13 Onderwerp: Re: WIN32LIB > Ad - where can this be found? > - John Coonrod > > ===== Original Message from Euphoria Programming for MS-DOS > <EUPHORIA at LISTSERV.MUOHIO.EDU> at 8/13/00 > >What you are discussing here is exactly what I had in mind when I tried to > >write a "Win32Lib Tutorial". My main goal was also to learn Win32 > >programming by writing down what I ran into, and what solutions there could > >be found. After posting a few of these "lessons", Wolfgang Fritz offered to > >help me, translating things into HTML and putting together a nice user > >interface. > >Ad Rienks