Re: Wierd error (PING ROB)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Robert Craig wrote:
> 
> Pete Lomax wrote:
> > Some wierd thing, hSaveStdout is a constant, defined as you will see
> > below. But using this constant /*/broke/*/ working code...
> > 
> > Bizarrely, calling c_func(xGetStdHandle..) inline works, but saving
> > this as a constant does not !!!!!!!
> > 
> > I get the same results on 2.4 and 2.5(a)...
> 
> I didn't try to run this code, but it wouldn't surprise me
> if you get a different value returned by GetStdHandle 
> before the puts() versus after it. The reason is that
> I don't create any console window until you do your first output
> to the screen. Maybe you could move the puts() before the constant
> declaration. The puts() will then be executed before the c_func() 
> that's assigned to the constant.

I can confirm (for Win2k, at least) that using the constant after you've
already created a console works fine.  Interestingly, it even seems to
work after a call to free_console().

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu