|
-
Feb 18th, 2002, 08:19 PM
#1
Thread Starter
Hyperactive Member
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.
-
Feb 18th, 2002, 08:21 PM
#2
Thread Starter
Hyperactive Member
Amon Ra
The Power of Learning.
-
Feb 19th, 2002, 09:02 AM
#3
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.
-
Feb 19th, 2002, 10:15 AM
#4
Thread Starter
Hyperactive Member
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.
-
Feb 19th, 2002, 12:16 PM
#5
Monday Morning Lunatic
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
-
Feb 19th, 2002, 06:56 PM
#6
Thread Starter
Hyperactive Member
cool..thanks guys
Amon Ra
The Power of Learning.
-
Feb 19th, 2002, 09:29 PM
#7
Thread Starter
Hyperactive Member
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.
-
Feb 19th, 2002, 10:57 PM
#8
Thread Starter
Hyperactive Member
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.
-
Feb 20th, 2002, 10:08 AM
#9
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.
-
Feb 20th, 2002, 10:53 AM
#10
Thread Starter
Hyperactive Member
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.
-
Feb 20th, 2002, 12:05 PM
#11
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.
-
Feb 20th, 2002, 06:49 PM
#12
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|