|
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
|
|
|
|
|
It contains information about the user settings. For example, which files are opened, which nodes in the 'explorer' window are expanded, the position of the breakpoints, ...
So, it is very user specific and doesn't need to be saved in CVS (and it shouldn't, because I think it is quite annoying to loose all this information each time).
|
|
|
|
|
The answer is great!
regards,
George
|
|
|
|
|
SUO means Solution User Options
|
|
|
|
|
Thanks toxcct!
regards,
George
|
|
|
|
|
Can you help me.
Help to be going to create Virtual IP using "iphlp" libarary raise just there is example code using c++
wait for your advice.
thank you.
ps : thanks is add "iphlp" library fils(iphlp.h , iphlp.dll ...)
|
|
|
|
|
I have created a Service exe thro VS6.0 Wizard and i am running a batch file from Run() method, in this batch file i am running java.exe.
It runs and functions correctly but if i kill java.exe thro task manager the service exe is still running.
How to make service exe also to exit when java.exe is no longer running ?
Any help would be appreciated...
Please help me....
|
|
|
|