-
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
-
-
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.
-
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
-
Pretty much, yeah.
I posted something on this, look for _IKDLL (or something similar).
-
-
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
-
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
-
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.
-
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?
-
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;
}
-
good thanks..CornedBee :)