|
Suppose one has a working application with the following structure
COrgMainFrame and COrgView loaded via a dll or unrelated part of the application.
At some point in time you need to change the behaviour of one of the classes, but you are prohibitted to do this at design time time. So you can't/may not create/use CMyNewView or CMyDifferentMainFrame. The only way is to implement this is at runtime. This means override the normal behaviour of the class at runtime, by loading a new windowproc function into the message handeling part of that window you want to change. Once this is done all windows messages passes your function first instead of the PreTranslateMessage function that normaly parses the messages. So one can delete certain messages being send to the normal PreTranslateMessage function or add new functions; and altering as such the behaviour of the Original class. This doesn't have anything to do with inheritance or objects this is 'normal' windows behaviour.
Each windowclass needs to be registerd in windows, this is normaly done by the MFC classes at creation of the window, this is needed to let windows now what windowproc needs to be called for this kind of window. Using the technique explained above one can alter the behaviour of one single instance of that class/window without changing the behaviour of other instances of the same object.
I hope I have explained it clearly ennough what I meant.
Like i said before I always thought that this was called subclassing in windows
codito ergo sum
|
|
|
|
|
|
|
|
Can u brief something about subclassing dialogitem and subclassing window
|
|
|
|
|
|
|
which company are u working ??
|
|
|
|
|
i'm working for zilog,bangalore.
n u?
|
|
|
|
|
why did u left spatial technologies(I) Ltd,Hyd. ???
|
|
|
|
|
What a discussion thread and out of context topics !!! .
|
|
|
|
|
not really all
NiLeSh KoRpE
|
|
|
|
|
|
What is message flow sequence in typical MFC Application.Where (in which class)all the default windows messages prossessed.
NiLeSh KoRpE
|
|
|
|
|
Hi,
I am using Visual Studio .net 2003 and i would like to output the debug log into a file. Is there an easy way to do this?
Than you in advance!
-gAZE
|
|
|
|
|
Consider using the following logging library:
http://axter.com/ezlogger/
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Sorry my first message was wrong template without ..
I have transfer onr project from VC 6.0 to Visual studio 2005. When I build it I get this error (C2146 && C4430) !
the code:
template<class element="">
class IterateurDeList : public Iterateur<element>
{
public:
std::list<element>* m_mylist;
std::list<element>::iterator m_itlist;
//declaration.....
}
e:\norman\projekt\e software entwicklung sba\r measure software\sbamess_v02_vs2005\iterateurdelist.h(22) : warning C4346: 'std::list::iterator' : dependent name is not a type
prefix with 'typename' to indicate a type
e:\norman\projekt\e software entwicklung sba\r measure software\sbamess_v02_vs2005\iterateurdelist.h(248) : see reference to class template instantiation 'IterateurDeList' being compiled
e:\norman\projekt\e software entwicklung sba\r measure software\sbamess_v02_vs2005\iterateurdelist.h(22) : error C2146: syntax error : missing ';' before identifier 'm_itlist'
e:\norman\projekt\e software entwicklung sba\r measure software\sbamess_v02_vs2005\iterateurdelist.h(22) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I need help to understand what I do wrong in this code.
Thank you
AutreChien
-- modified at 5:58 Friday 12th May, 2006
|
|
|
|
|
NorGUI wrote: std::list<element>* m_mylist;
std::list<element>::iterator m_itlist;
Try this:
typename std::list<Element>* m_mylist;
typename std::list<Element>::iterator m_itlist;
Steve
|
|
|
|
|
Hi,
you need to specify what kind of list you want, suppose an int
class IterateurDeList : public Iterateur
{
public:
std::list<int> m_mylist;
std::list<int>::iterator m_itlist;
}
codito ergo sum
-- modified at 4:14 Friday 12th May, 2006
|
|
|
|
|
i'd suggest you to use typename in template parameters...
moreover, it seems that you don't end your class definition with the required ;
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Please, don't delete your post once you get an answer
This can also be usefull for others.
Cédric Moonen
Software developper
Charting control
|
|
|
|
|
damn !!!!! and moreover, he mailed me to ask more informations about what it meant to add typename in the template
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
toxcct wrote: he mailed me to
A lot of crappy newbies have mailed me ...
Maxwell Chen
|
|
|
|
|
Sorry but it is the first time that I ask question on forum!
Let me learn how it's works...
AutreChien
|
|
|
|
|