|
Use WindowFromPoint() , then you can iterate through the parent windows to find the top level window.
|
|
|
|
|
Why MFC not supporting Multiple Inheritence ?could tell me the reasons , behind the architecture plz.
|
|
|
|
|
Krishnatv wrote: Why MFC not supporting Multiple Inheritence ?
it's C++, so it does.
what makes you say so ?
|
|
|
|
|
C++ Supports Multiple inheritence...that is OK .
Iam asking why MFC not supports Multiple inheritence.
|
|
|
|
|
Krishnatv wrote: Iam asking why MFC not supports Multiple inheritence
so i reapeat : WTF makes you say so ?
|
|
|
|
|
MFC does support multiple inheritance.
But its not designed in such a way.
Every(should be most) objects are derived from CObject, but none of them are virtual.
This makes that deriving from two MFC parent classes will result in two different root objects.
This is surely bad for the whole MFC design.
So one might say MFC doesn't support Multiple Inheritance in a Usable way.
Adding your own class(non MFC derived) should work.
codito ergo sum
|
|
|
|
|
One problem with MFC and multiple inheritance is that nearly all MFC classes are ultimately derived from CObject. If you then inherit from 2 MFC classes for a new class it gets 2 copies of CObject internally and which one existing code refers to is then ambiguous. This screws up things like MFC Serialization which rely on funtions inherited from CObject. The reasons why virtual inheritance was not used within the MFC Framework to prevent this being a problem are obscure. Someone with C++ guru status would probably be able to explain it.
I have a feeling that there are ways to make it work with a lot of effort becuase I remember seeing an article on CodeProject that claimed to have a solution. I didn't read it or save a link so you'll need to hunt for it yourself if you're interested.
In most cases multiple inheritance can be avoided anyway by making one of the bases a class member instead and exposing the parts of the interface you want by writing your own wrappers. Have a look at some of the tricks ATL uses aswell with template paremters used for base classes; an alternative powerful technique that can sometimes meet your requirements instead of using multiple inheritance.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thank you for Nice reply.
|
|
|
|
|
Am I correct to say that if you build you own class - not MFC based - than you can do multiple inheritance in MFC "enviromwent"?
|
|
|
|
|
Matthew Faithfull wrote: Have a look at some of the tricks ATL uses aswell with template paremters used for base classes; an alternative powerful technique that can sometimes meet your requirements instead of using multiple inheritance.
That seems to say "use the ATL technique "instead of" multiple inheritance"
|
|
|
|
|
Is it possible to 'tell'(force) a program to perform copy to clipboard(ctrl+C)?
|
|
|
|
|
can it help?
if ( !OpenClipboard() )
{
AfxMessageBox( "Cannot open the Clipboard" );
return;
}
if( !EmptyClipboard() )
{
AfxMessageBox( "Cannot empty the Clipboard" );
return;
}
if ( ::SetClipboardData( CF_??, hData ) == NULL )
{
AfxMessageBox( "Unable to set Clipboard data" );
CloseClipboard();
return;
}
CloseClipboard();
Russell
|
|
|
|
|
|
|
Did you get this message when you want to load any dll?
|
|
|
|
|
The problem is not related to your code but to some of the third party applications you may have installed. Try uninstalling KB925902 hotfix, and/or any software upgrades you have recently installed.
|
|
|
|
|
|
Hello All,
How can I change window title shown as tool tip text in the Taskbar using MFC.
With Thanks,
Karthik.
Software - Bundle of bugs covered with features.
|
|
|
|
|
What shows in the tooltip is simply the current caption of your window. So you can use SetWindowText() to change it. Note, though, that this is not always advisable, especially if writing in MFC - the MFC framework handles the window title.
|
|
|
|
|
Hi
I want to do bidirectional parallel port communication
will any plz help in this regard
uzmeed
the more u give the most u receive
|
|
|
|
|
|
|
Hello everyone,
I am wondering what is the function of .suo file? If I want to share source codes with other people, for example, using CVS or something similar, does this file mandatory to check-in? Do other people need this file to make a same build and setup the same working environment as mine?
thanks in advance,
George
|
|
|
|
|
No, you don't need to share this file. The only files that you need to save into CVS are the source files (.cpp and .h), the solution file (.sln) and the project files (.vcproj, one for each project in your solution). This is for VS2005, for VC6 the project and 'solution' files are different (.dsw and .dsp) and for VS2003, I don't know
|
|
|
|
|
Thanks Cédric,
What is the function of .suo file?
regards,
George
|
|
|
|