1. RE: Accessing Win API

lists at wordit.com wrote:
> On 13.04.02 at 17:26 Wolf wrote:
> >You *could* be a bit more specific  blink
> 
> The API function is "ReadDirectoryChangesW".
> 
> If anybody could give me a basic outline on how to get started it would
> be a great help. I'm not familiar with Win32 API, so that makes a bit
> more difficult.
> 
> 
> >There are literally thousands of examples in hundred's of programs on
> the
> >EU contributions page, as well as examples in
> >Euphoria\Demo\Win32
> 
> >It's all done thru  link_dll,  define_c_func,  define_c_proc... one
> way or
> >another...
> 
> Any example in particular that might be good for newbies?
> 
> Thanks,
> 

Marcus:
   I would suggest that if you don't have any knowledge of
   win32 programming that you start with something simpler.
   If you read the doucuments that come with Euphoria then
   in the Euphoria\demo\win32 directory you will find
   a example program called window.exw which is what you have
   to do just to create a window. If this is too difficult to
   understand then use the win32lib which handles all the complicated
   things for you. The function above is a unicode function
   and you will need to create unicode strings to use it.
Bernie

new topic     » topic index » view message » categorize

2. RE: Accessing Win API

Hello Marcus!

One of the reasons that I started working with Euphoria was because of
the fact that I couldn't understand the Windows API for the life of me,
but I wanted to write Windows apps.  That also made me zero in on
win32lib.ew instantly, which back then was much more limited than it is
now.

As I looked through the source code of win32lib, I discovered how it
worked, suddenly the Windows API began to make a LOT more sense to me.
So I'd also suggest you take a look at the innards of win32lib.ew, which
will give you some insight into the workings of the API that it wraps.  

Hope I've helped you some,

Travis Beaty
Evans, Colorado.

"The Arkansas legislature passed a law that states that the Arkansas
River can rise no higher than to the Main Street bridge in Little
Rock."



   :  -----Original Message-----
   :  From: Bernie Ryan [mailto:xotron at localnet.com]
   :  Sent: Sunday, April 14, 2002 9:56 AM
   :  To: EUforum
   :  Subject: RE: Accessing Win API
   :  
   :  
   :  lists at wordit.com wrote:
   :  > On 13.04.02 at 17:26 Wolf wrote:
   :  > >You *could* be a bit more specific  blink
   :  >
   :  > The API function is "ReadDirectoryChangesW".
   :  >
   :  > If anybody could give me a basic outline on how to get started
it
   :  would
   :  > be a great help. I'm not familiar with Win32 API, so that makes
a
   :  bit
   :  > more difficult.
   :  >
   :  >
   :  > >There are literally thousands of examples in hundred's of
programs
   :  on
   :  > the
   :  > >EU contributions page, as well as examples in
   :  > >Euphoria\Demo\Win32
   :  >
   :  > >It's all done thru  link_dll,  define_c_func,  define_c_proc...
one
   :  > way or
   :  > >another...
   :  >
   :  > Any example in particular that might be good for newbies?
   :  >
   :  > Thanks,
   :  >
   :  
   :  Marcus:
   :     I would suggest that if you don't have any knowledge of
   :     win32 programming that you start with something simpler.
   :     If you read the doucuments that come with Euphoria then
   :     in the Euphoria\demo\win32 directory you will find
   :     a example program called window.exw which is what you have
   :     to do just to create a window. If this is too difficult to
   :     understand then use the win32lib which handles all the
complicated
   :     things for you. The function above is a unicode function
   :     and you will need to create unicode strings to use it.
   :  Bernie
   :  
   :
   :

new topic     » goto parent     » topic index » view message » categorize

3. RE: Accessing Win API

euman at bellsouth.net wrote:
> ----- Original Message ----- 
> From: "Euler German" <efgerman at myrealbox.com>
> 
> > Euman,
> > 
> > What about ol' Petzold's Programming Windows 95? Do you think it can 
> > help?
> > 
> > -- Euler
> 
> I have never read the book but I think David started Win32lib by basing
> the code on that book. I think if you ask Derek if he would have done it
> this way he'll tell you no 

This is true. I would do it differently now.

> and maybe even David dropping the project
> may be due to the way he started the library and not wanting to go back
> and change everything but, this is just a guess......So, dont base a 
> project on
> what you learn from one book!
> 

Or one person!

> There are too many lines in Win32lib that make the library redundant, 
> over
> sized and slow.."note: I didnt say very slow". 
> I dont know enough yet to
> comment on how it shouldve been written but I have ideas.
> 
> Anyone who uses Win32lib is stuck in the loop of having code that is 
> poor
> in performance, size and bug ridden. 

Of course, this is just one person's opinion. Others might disagree blink


>Currently there are only a handfull of
> people that can write code for Win32lib so your stuck if you have a bug
> creap up. 

And that statistic is based on what, exactly?

>Learn to write API from the get-go and you'll be better off in the long
> run. Write your own darn code then you'll feel better about yourself and 
> learn
> more, faster...Programs will take many times longer to develop in the 
> beginning
> but well worth the time spent researching info either on the net, from 
> books or
> the MS-SDK.
> 

That is exactly why win32lib and others like it were written. It is 
generally a compromise on ease-of-use over performance. If you have a 
modern machine, say one manufactured in the last 2-years, the speed 
differential is neglible. If one was really trying to write code for 
speed, one wouldn't be using Euphoria anyway; assembler code can be an 
order of magnitude faster and smaller. (Plus about 1000 times slower to 
write.)

If you want to write Windows programming from the ground up, then you 
can start with win32lib, but you'd be better served by specific books 
that address this area. 

It should be noted that most Windows programming is NOT done using the 
API directly. C++ users tend to use Microsoft Foundation Classes or 
Borland's OWL system, which hides all the API stuff, and of course 
Visual Basic and Delphi programmers almost never have to code direct API 
calls. Now with C# coming along, we have even less reasons to use direct 
API calls. 

Check out Masm32 at http://www.movsd.com/masm.htm for really speeding 
Windows programs. As Euman says, doing this way it takes more time to 
write and debug, but eventually you will get very fast Windows programs.

> I would like to see Win32lib answer what this API means to a program
> seterrmode = define_c_func(kernel32,"SetErrorMode",{C_UINT},C_UINT) 
> junk = c_func(seterrmode,{SEM_FAILCRITICALERRORS})
> 
> hehe just a joke Derek, Matt, Wolf, David..etc

Sorry, Euman but I don't get it. What joke? According to the MSDN site, 
this means :

"The system does not display the critical-error-handler message box. 
Instead, the system sends the error to the euman at bellsouth.net. "


--------
Derek.

new topic     » goto parent     » topic index » view message » categorize

4. RE: Accessing Win API

On 14.04.02 at 15:55 Bernie Ryan wrote:
>   I would suggest that if you don't have any knowledge of
>   win32 programming that you start with something simpler.
>...The function above is a unicode function
>   and you will need to create unicode strings to use it.

Thanks Bernie. I'll take a look at the ones you mentioned...and
hopefully return ready to ask Unicode questions smile
"ReadDirectoryChangesW" does look like a more complicated function.

Marcus

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu