RE: poke4 won't accept my 32bit values
- Posted by Chris Bensler <bensler at mailops.com> Mar 18, 2001
- 534 views
So as to clarify.. I am still using WinMain, but how it is supposed to work.. WinMain takes the Init, Main and Exit routines as handles.. With My Lib, I have split WinMain, into the 3 seperate components.. WinMain is Initialized, in the users Init code, Then the message loop is called through the users Main code... and there is no Exit components for WinMain, they are already internal.. The problem lies, where I split the message loop from the WinMain code.. For all practical purposes, this works OK, only when I try to pass a 32bit value to my seperated version do I run into problems.. It's difficult to explain, you really just need to see my examples to understand.. FYI: the range I am using is #00000000 - #FFFFFFFF . 32bit color values I think, it's something along the lines of what you're saying.. I believe the values are being cropped to 8bit integer values.. Thus returning an error saying the value must be a 32bit integer. Chris Robert Craig wrote: > Chris Bensler writes: > > ...when the code does not pass through WinMain, > > it doesn't allow me to poke4 the values, resulting > > in incorrect colors.. > > I'm not sure what you are doing, but > keep in mind that Euphoria routines, such as poke4(), > deal with data in Euphoria's internal format. > Euphoria integers and C integers are the same, > as long as you are in the range of (roughly) -1 billion > to +1 billion. Outside of this range a Euphoria library > routine will interpret the number to be a kind of pointer to > a double or a sequence. To pass a 32-bit integer, > outside of the range, you would have to create a pointer > to a double, like what NewDouble() returns, and pass that. > This is very tricky, not for the faint of heart. > > Also, WinMain() causes a lot of necessary stuff to > be initialized. If you skip it, some things won't work right. > > Regards, > Rob Craig > Rapid Deployment Software > http://www.RapidEuphoria.com > >