1. David Win32lib

David
  How come the create function in windows does not pass all 12 parameters
  in the win32lib. This is going to come back to haunt you.
  If you want to impliment new advance features in the library that use
  these extra parameters then you have to go around the Create function with
  the CreateWindow function that you have made non-standard by remapping it
  to the CreateWindowExA ( I understand that they are the same except for
  the extended styles ) but this is going to confuse users when they try
  to use library functions using some code from a windows book. The next
  problem if you can't use the create function then the user has to write
  all the message handling routines because if you use CreateWindow
  function then you can't use onEvent. This means that there can't be
  any connection between a window defined with Create and a window defined
  with CreateWindow without alot of extra coding.
Bernie

new topic     » topic index » view message » categorize

2. Re: David Win32lib

Bernie Ryan wrote (with minor editing):

> How come the create() function in Win32Lib does not
> pass all 12 parameters to CreateWindow?

There are a couple of reasons:

   1. Win32Lib is a simplication of the Win32 API.
      By definition, some information will be lost
      in that process.

   2. Win32Lib does not attempt to wrap everything
      in the Win32 API. Unlike Llama, it was not
      built to be extensible by the user.

   3. Some parameters, like the menu handle, simply
      don't make sense to use.

   4. I'd never had the need to use some parameters,
      like extended style. If I had the need, I could
      always change the code (see below).

   5. Some parameters, like the program instance
      handle, I never really understood that well.

> If you want to implement new advanced features
> in the library that use these extra parameters
> then you have to go around the create function ...

*shudder*

No, it's actually much easier. Create a new set of
class attributes - say, 'classExt' - that would hold
the extended attributes for a class. Existing classes
obviously have extended attributes of zero.

To create a new class with extended attributes, you
would write something like this:

-- #40: NewClass
    className[ NewClass ] = <class name>
    classType[ NewClass ] = <class identifier>
    classStyle[ NewClass  ] = <style flags>
    classExt[ NewClass ] = <extended style flags>

The change to the create() code would be:

-- create control
window_handle[id] = c_func( xCreateWindow, {
            classExt[id], -- extended style
            buffer1,      -- window class name
            ...
            NULL} )       -- creation parameters

And there you have it - support for extended attributes.

Pretty trivial, actually.

-- David Cuny

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

3. Re: David Win32lib

Thank You David
  I will have to sit down and study your instructions.
Bernie

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

4. Re: David Win32lib

On Fri, 23 Jul 1999 12:22:37 -0700, Cuny, David <David.Cuny at DSS.CA.GOV>
wrote:
>
>No, it's actually much easier. Create a new set of
>class attributes - say, 'classExt' - that would hold
>the extended attributes for a class. Existing classes
>obviously have extended attributes of zero.
>
>To create a new class with extended attributes, you
>would write something like this:
>
>-- #40: NewClass
>    className[ NewClass ] = <class name>
>    classType[ NewClass ] = <class identifier>
>    classStyle[ NewClass  ] = <style flags>
>    classExt[ NewClass ] = <extended style flags>
>
>The change to the create() code would be:
>
>-- create control
>window_handle[id] = c_func( xCreateWindow, {
>            classExt[id], -- extended style
>            buffer1,      -- window class name
>            ...
>            NULL} )       -- creation parameters
>
>And there you have it - support for extended attributes.
>
>Pretty trivial, actually.

David
  Not so trivial how will this allow me to pass the creation parameter
  with out changing the parameter list to your Create function ?
Bernie

Bernie

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

5. Re: David Win32lib

Bernie Ryan wrote:

>  Not so trivial. How will this allow me to pass
> the creation parameter with out changing the
> parameter list to your Create function ?

Obviously, you don't. You would define a new *class* for that control, and
then create a control based on that class. The extended parameters are
associated with the control's class.

Why not give an example of the kind of control you are trying to create?
That way, I can give you a concrete example.

-- David Cuny

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

6. Re: David Win32lib

Hi, Bernie.

Ignore the prior message; I was confusing extended attributes with something
else.

I'll give some thought to extended parameters...

-- David Cuny

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

7. Re: David Win32lib

Thanks Bernie

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

Search



Quick Links

User menu

Not signed in.

Misc Menu