1. popSelf( ) wont fly
- Posted by Al Getz <xaxo at AOL.COM> Sep 12, 2000
- 454 views
- Last edited Sep 13, 2000
quoted from Win32Lib v0.52 9/12/00: >> -- NEW! 0.41 function popSelf() -- pop the current id from the stack << The problem here is the function needs to be declared as global so that other .ew files can call it when needed. --Al
2. Re: popSelf( ) wont fly
- Posted by Derek Parnell <derekp at solace.com.au> Sep 13, 2000
- 457 views
Hi Al, why do you need to use popSelf()? This is really an internal routine only. Maybe I can see another way around your problem if you can let me know what it is you are trying to achieve. ----- cheers, Derek Parnell derekp at solace.com.au Solace Limited ( http://www.solace.com.au ) Melbourne, Australia +61 3 9291 7557
3. Re: popSelf( ) wont fly
- Posted by Al Getz <xaxo at AOL.COM> Sep 13, 2000
- 426 views
Hi Derek, Matt suggested using getSelf() to return the id but since its not global it cant be used by an external program. Returning the id of the control is important for at least these reasons: 1. User created message map to handle control functions not handled by Win32Lib (what i need now). This is what the original intent of onEvent() was (somewhat). 2. Enumerated controls: for messageing a large number of controls of the same type, such as a calculator keypad. Makes the processing code neat and compact if you can decode which of your controls is being serviced. This is especially true when the controls are very much the same (such as an alpha keypad). 3. A large number of C functions require the hwnd of the control in order to call the function. Here's just one example: hTarget=c_func(xSendMessage,{hwndFrom,TVM_HITTEST,0,lphti}) This is just one of many possible function calls and even the wrapped version still requires the id of the control. So how else would one use "sendMessage()" without knowing the id? Having the id also allows getting the hwnd if desired. Using sendmessage() in either form is an important part of the windows API, and thats only one example. A lot more functions require the hwnd of the control, so im surprised no one else said anything yet. Is anyone using it that much? The only way around the above that i can see is to add code to winlib which then makes it somewhat specialized. It would be better to allow the user to create his own message map if needed. This allows for more flexibility also. To do this, the id has to be known. Since getSelf() achieves all these goals, why not just make it a global? --Al
4. Re: popSelf( ) wont fly
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Sep 13, 2000
- 442 views
Hi Al, getSelf() is global. I don't know what version of win32lib you are using, but its been global for awhile now, I believe. ----- Original Message ----- From: "Al Getz" <xaxo at AOL.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Wednesday, September 13, 2000 5:00 PM Subject: Re: popSelf( ) wont fly > Hi Derek, > > Matt suggested using getSelf() to return the id but since its not > global it cant be used by an external program. > > Returning the id of the control is important for at least these reasons: > > 1. User created message map to handle control functions not handled > by Win32Lib (what i need now). This is what the original intent > of onEvent() was (somewhat). > > 2. Enumerated controls: for messageing a large number of controls > of the same type, such as a calculator keypad. Makes the processing > code neat and compact if you can decode which of your controls > is being serviced. This is especially true when the controls > are very much the same (such as an alpha keypad). > > 3. A large number of C functions require the hwnd of the control > in order to call the function. Here's just one example: > > hTarget=c_func(xSendMessage,{hwndFrom,TVM_HITTEST,0,lphti}) > > This is just one of many possible function calls and even > the wrapped version still requires the id of the control. > So how else would one use "sendMessage()" without knowing the id? > Having the id also allows getting the hwnd if desired. > Using sendmessage() in either form is an important part of the > windows API, and thats only one example. A lot more functions > require the hwnd of the control, so im surprised no one else > said anything yet. Is anyone using it that much? > > > The only way around the above that i can see is to add code to winlib > which then makes it somewhat specialized. It would be better to > allow the user to create his own message map if needed. This allows > for more flexibility also. To do this, the id has to be known. > > Since getSelf() achieves all these goals, why not just make it a global? > > --Al