Results 1 to 12 of 12

Thread: message processing

  1. #1

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    message processing

    let's say i create a window and want to subclass it.. let's say my window creation process is wrapped in a class.. and i have a function called allowsubclasswindow(which changes the wndproc if wanted...not the problem) and a function called AddSubclassMessage(which adds a message that would be subclassed) how would i tell the window to call the wndproc for sublcassing when it receives these messages? without having to write a wndproc with switch..case...for specific messages.., but rather for any message that is added to the window's subclassmessage? it probably sounded horrible, but would anyoen be able to help me?
    thanks a lot
    Amon Ra
    The Power of Learning.

  2. #2

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Talking

    everything is in a dll
    Amon Ra
    The Power of Learning.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    suppose all messagesare stored by number in an array, you could use a for-loop through the array and test if message == current array entry. I see no other way.
    Of course, if the array is sorted or a binary tree, you could make it faster.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Smile

    thanks. basically i could add messages to an array, and have the wndproc check if the messages are the ones that want to be subclassed, and if so, set up the other wndproc(for subclassing), right?

    just one quick question: how do i export a class from a dll? do i just put

    PHP Code:
    _dllspec(export) class... 
    and then _dllspec(import) in a header (not part of dll)containing the class as well?thats what i saw on msdn..just wanna make sure..

    thanks

    Amon Ra
    Amon Ra
    The Power of Learning.

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Pretty much, yeah.

    I posted something on this, look for _IKDLL (or something similar).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    cool..thanks guys
    Amon Ra
    The Power of Learning.

  7. #7

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    is it bad to create a class without methods? cuz i have a big structure, but no default values can be put there.
    i could just create class , with the constructor initializing the variables, right?
    thanks
    Amon Ra
    The Power of Learning.

  8. #8

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    nevermind about the class without methods..
    the other qwuestion is:
    i have a structure (not huge but not small). I created a class that could change values from that structure. so that i have very few member variables in my class, which i find cleaner(there would be quite a few). what i did is write functions that accept a pointer to the structure, to change or retrieve values from it. the thing is that i wont change ALL the values, so does it matter if i make a pointer to the structure considering its size? thanks
    Amon Ra
    The Power of Learning.

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I'd either move the members of the structure to the class or have such a structure as member of the class. Otherwise it somehow looses the sense of a class.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    put the strcture as a member of the class? so i just put the structure in the class? i have to create an object from the strucure to use in the class right?
    Amon Ra
    The Power of Learning.

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Code:
    typedef struct LONGDATASTRUCTURE_I_DONT_WANT_TO_REPLACE
    {
      int iData;
      float fData;
      // millions of other members
    } LDS;
    
    class LDSWRAPPER : public LDS
    {
      // yeah
    };
    
    // or:
    class LDSWRAP2
    {
    private:  // could also be public or protected
      LDS m_ldsData;
    }
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    good thanks..CornedBee
    Amon Ra
    The Power of Learning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width