1. Accessing Win API

Does anybody have an example on how to access the Win32 API from EU?
I need to access a particular API function.

Thanks,

Marcus

new topic     » topic index » view message » categorize

2. Re: Accessing Win API

> Does anybody have an example on how to access the Win32 API from EU?
> I need to access a particular API function.

You *could* be a bit more specific  blink
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...

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

3. Re: Accessing Win API

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

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

4. Re: Accessing Win API

Hello,

If you want to spend the rest of your life figuring out Win32lib then
more power to you but if you really want a leg-up on Win API then,
I would suggest getting a book and actually reading the explanations
the author gives for each API routine...A C/C++ language book that 
got me started was Windows Programming Annotated Archives Code 
with Commentary by Herberb Schildt. Probably cant find this particular 
book anymore but there are dozens like it.

Win32lib will only make your head swim simply because its far more
advanced than you need as a beginner. Sorry Tone to step in there but
if he doesnt know what API calls do then Win32lib wont help at all.

Euman
euman at bellsouth.net

...if the US Government were ever to get really serious about Internet 
security, the top players in Microsoft's management hierarchy would find 
themselves handcuffed, blindfolded, led onto a tarmac within some obscure 
Air Force base, and shot.
-- Thomas C Greene (http://www.theregister.co.uk/content/55/23223.html)
-- Kat will like this one!


----- Original Message ----- 
From: "Travis Beaty" <travis_beaty at mcleodusa.net>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, April 14, 2002 3:29 PM
Subject: 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

5. Re: Accessing Win API

Euman,

What about ol' Petzold's Programming Windows 95? Do you think it can 
help?

-- Euler

On 14 Apr 2002, at 16:54, euman at bellsouth.net wrote:

> 
> Hello,
> 
> If you want to spend the rest of your life figuring out Win32lib then
> more power to you but if you really want a leg-up on Win API then, I
> would suggest getting a book and actually reading the explanations the
> author gives for each API routine...A C/C++ language book that got me
> started was Windows Programming Annotated Archives Code with Commentary
> by Herberb Schildt. Probably cant find this particular book anymore but
> there are dozens like it.
> 
> Win32lib will only make your head swim simply because its far more
> advanced than you need as a beginner. Sorry Tone to step in there but if
> he doesnt know what API calls do then Win32lib wont help at all.
> 
> Euman
> euman at bellsouth.net
> 
> ...if the US Government were ever to get really serious about Internet
> security, the top players in Microsoft's management hierarchy would find
> themselves handcuffed, blindfolded, led onto a tarmac within some
> obscure Air Force base, and shot. -- Thomas C Greene
> (http://www.theregister.co.uk/content/55/23223.html) -- Kat will like
> this one!
> 
> 
> ----- Original Message ----- 
> From: "Travis Beaty" <travis_beaty at mcleodusa.net>
> To: "EUforum" <EUforum at topica.com>
> Sent: Sunday, April 14, 2002 3:29 PM
> Subject: 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
<snip>

> 
> 
>

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

6. Re: Accessing Win API

----- 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 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!

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. Currently there are only a handfull of
people that can write code for Win32lib so your stuck if you have a bug
creap up. 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.

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

Euman

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

7. Re: Accessing Win API

On Monday 15 April 2002 01:00 am, you wrote:
>
> 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. "
>

Excellent idea - but can euman's mail server handle such a volume of 
error messages?  We might as well try - those Windows error messages 
don't do the *programmer* any good. Maybe euman will enjoy them.

Regards,
Irv

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

8. Re: Accessing Win API

Euler German wrote:

>Anyone who uses Win32lib is stuck in the loop of having code that is poor 
>in performance, size and bug ridden.

Ouch.

I can speak to a couple of these issues, but keep in mind that I haven't 
really looked though Win32Lib in a while - there have been quite a few 
changes since I (gratefully) left it with Derek.

Win32Lib was written for ease of use, and (especially with Judith's IDE) I 
think it's achieved that. The tradeoff, unfortunately, is speed.

A case in point is the handling of fonts. The old version of Win32Lib 
basically created a new font every time there was a call to a routine that 
used fonts. This was horribly expensive, but it hid the nasty details from 
the user, and (attempted to) prevent resource leaks.

As for Win32Lib is 'bug ridden', I suspect that's a bit harsh. And keep in 
mind that the author of any software program can't fix bugs they don't know 
about. So one of the best ways to fix Win32Lib is to report any known bugs 
to Derek.

Sure, you could 'roll your own' version, but in retrospect, I wish that 
someone else had written Win32Lib, so I could have been doing more 
interesting things.

Just my (probably obsolete) two cents.

-- David Cuny

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

9. Re: Accessing Win API

Euler German wrote:

>Anyone who uses Win32lib is stuck in the loop of having code that is
poor 
>in performance, size and bug ridden.


David Cuny wrote:

> Win32Lib was written for ease of use, and (especially with Judith's
IDE) I 
> think it's achieved that. The tradeoff, unfortunately, is speed.

I, for one, never would have been able to start programming in Windows
without Win32Lib.  Visual Basic was too expensive, and Java was too slow
and cumbersome for simple small business apps.

> As for Win32Lib is 'bug ridden', I suspect that's a bit harsh. And
keep in 
> mind that the author of any software program can't fix bugs they
don't know 
> about. So one of the best ways to fix Win32Lib is to report any known
bugs 
> to Derek.

Well said.  Not to mention that if I tried to do natively what I'm
doing in Win32Lib (and I have tried, and gave up quickly), I'd be bald
by now trying to find the one line with the wrong parameter.  I'm very
grateful to all those who have found the bugs for me, added features I
could never figure out, and prepackage it in such a way as to make it a
real solution to real problems.

> Just my (probably obsolete) two cents.

Obsolete coins are worth a whole lot more than new ones blink.

Michael J. Sabal

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

10. Re: Accessing Win API

On Monday 15 April 2002 04:47 pm, Mike wrote:
>
> Euler German wrote:
> >Anyone who uses Win32lib is stuck in the loop of having code that is
>> poor
> >in performance, size and bug ridden.

Actually, it was euman who wrote that (no surprise). However, he could 
have said exactly the same thing about Windows itself. - if you use it, 
you are "stuck in the loop of having code that is poor in performance, 
size and bug ridden." 

Even the dozen or so people in the world who write Windows programs 
in assembler don't gain much in the way of speed or stability, so where 
does the blame really lie? 

> David Cuny wrote:
> > Win32Lib was written for ease of use, and (especially with Judith's
> > DE) I think it's achieved that. The tradeoff, unfortunately, is speed.
>
> I, for one, never would have been able to start programming in Windows
> without Win32Lib.  Visual Basic was too expensive, and Java was too slow
> and cumbersome for simple small business apps.

Amen. I had really bad experiences with VB a few years ago, and I don't 
expect enough improvements have been made that it would now suddenly be 
useful.  I certainly wouldn't waste any money to find out. 

But all of that's academic, because I now avoid Windows whenever possible.

Regards,
Irv

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

11. Re: Accessing Win API

On 15 Apr 2002, at 20:04, David Cuny wrote:

> 
> Euler German wrote:
> 

No. I did not. These are not my words. As a matter of fact, I never 
used Win32Lib before, so I will not share any opinions on it.

-- Euler

> >Anyone who uses Win32lib is stuck in the loop of having code that is
> >poor in performance, size and bug ridden.
> 
> Ouch.
> 
> I can speak to a couple of these issues, but keep in mind that I haven't
> really looked though Win32Lib in a while - there have been quite a few
> changes since I (gratefully) left it with Derek.
> 
> Win32Lib was written for ease of use, and (especially with Judith's IDE)
> I think it's achieved that. The tradeoff, unfortunately, is speed.
> 
> A case in point is the handling of fonts. The old version of Win32Lib
> basically created a new font every time there was a call to a routine
> that used fonts. This was horribly expensive, but it hid the nasty
> details from the user, and (attempted to) prevent resource leaks.
> 
> As for Win32Lib is 'bug ridden', I suspect that's a bit harsh. And keep
> in mind that the author of any software program can't fix bugs they
> don't know about. So one of the best ways to fix Win32Lib is to report
> any known bugs to Derek.
> 
> Sure, you could 'roll your own' version, but in retrospect, I wish that
> someone else had written Win32Lib, so I could have been doing more
> interesting things.
> 
> Just my (probably obsolete) two cents.
> 
> -- David Cuny
>

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

12. Re: Accessing Win API

On 15 Apr 2002, at 16:47, Sabal.Mike at notations.com wrote:

> 
> Euler German wrote:
> 

No. I did not. These are not my words.

-- Euler

> >Anyone who uses Win32lib is stuck in the loop of having code that is
> poor 
> >in performance, size and bug ridden.
> 
> 
> David Cuny wrote:
> 
> > Win32Lib was written for ease of use, and (especially with Judith's
> IDE) I 
> > think it's achieved that. The tradeoff, unfortunately, is speed.
> 
> I, for one, never would have been able to start programming in Windows
> without Win32Lib.  Visual Basic was too expensive, and Java was too slow
> and cumbersome for simple small business apps.
> 
> > As for Win32Lib is 'bug ridden', I suspect that's a bit harsh. And
> keep in 
> > mind that the author of any software program can't fix bugs they
> don't know 
> > about. So one of the best ways to fix Win32Lib is to report any known
> bugs 
> > to Derek.
> 
> Well said.  Not to mention that if I tried to do natively what I'm
> doing in Win32Lib (and I have tried, and gave up quickly), I'd be bald
> by now trying to find the one line with the wrong parameter.  I'm very
> grateful to all those who have found the bugs for me, added features I
> could never figure out, and prepackage it in such a way as to make it a
> real solution to real problems.
> 
> > Just my (probably obsolete) two cents.
> 
> Obsolete coins are worth a whole lot more than new ones blink.
> 
> Michael J. Sabal
>

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

13. Re: Accessing Win API

Euler German wrote:

> No. I did not. These are not my words.

Ooops! In my haste, I figured "Eu...man" meant "Euler German."

Sorry for putting someone else's words in your mouth.

-- David Cuny

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

14. Re: Accessing Win API

My apologies.  My email program was just replying to a reply of a reply
and got confused as to the original quote.  No offense or mis-requotes
intended.

Mike Sabal

>>> efgerman at myrealbox.com 04/15/02 11:53PM >>>

On 15 Apr 2002, at 16:47, Sabal.Mike at notations.com wrote:

> 
> Euler German wrote:
> 

No. I did not. These are not my words.

-- Euler

> >Anyone who uses Win32lib is stuck in the loop of having code that
is
> poor 
> >in performance, size and bug ridden.

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

15. Re: Accessing Win API

On 16 Apr 2002, at 8:49, Sabal.Mike at notations.com wrote:

> 
> My apologies.  My email program was just replying to a reply of a reply
> and got confused as to the original quote.  No offense or mis-requotes
> intended.
> 
> Mike Sabal
> 
No offense at all Mike. I figured that could be something like this at 
the first moment. Just trying to avoid possible flames. :)

Cheers!

-- Euler

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

16. Re: Accessing Win API

On 14 Apr 2002, at 22:11, David Cuny wrote:

> 
> Euler German wrote:
> 
> > No. I did not. These are not my words.
> 
> Ooops! In my haste, I figured "Eu...man" meant "Euler German."
> 
Look at that! Could be. I suppose this stands for EUphoria MAN but I 
think it's better to ask him personally. Anyway, he's a lot better 
(coder) than I am. :)

> Sorry for putting someone else's words in your mouth.
> 
> -- David Cuny
> 
Never mind David.

Just being careful trying to not step on anyone's toes. ;)

-- Euler

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

17. Re: Accessing Win API

Euman
> Anyone who uses Win32lib is stuck in the loop of having code that is poor
> in performance, size and bug ridden. Currently there are only a handfull of
> people that can write code for Win32lib so your stuck if you have a bug
> creap up. 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.

I use win32lib because I just don't like the POKEmonish code
(allocate,poke,c_proc,
free) Without having most of the code constructing the API calls, there's more
time for focusing on the actual problem. It is apparent that creating an
API over API causes some speed/functionality loss.
I also don't want to binded too much to Micrsoft and their API. If we had kind
of
cross-platform win32lib...

That's just my opinion.

    Martin

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

Search



Quick Links

User menu

Not signed in.

Misc Menu