|
Hi. Just use the base's name:
class bar : public foo {
public:
void myMethod() { foo::myMethod(); cout << "\tthis part is in bar" << endl; }
};
There's no specific keyword, since C++ allows multiple inheritance and therefore it is not guaranteed that one class has one and only one base class.
Regards.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
Thanks ! Going back to C++ continues to remind me how different it really is from C#
|
|
|
|
|
Visual C++ provides a non-standard keyword __super[^] that does that. Not that I recommend it
|
|
|
|
|
To expand on Fernando's answer - you can't really have a 'base' or 'super' keyword in C++ because a C++ class can inherit from multiple non-abstract bases.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi
I'm trying to save image from webBrowser control after a open webpage.
It is like right clicking on the picture and clicking at "Save Picture As..." Context menu, except I wanted to do it
programmaticaly with out showing save dialog box.
I tried
this->webBrowser1->Document->execcommand("Save As", false, strFilePath);
it does not work.
Some one Knows better way?
|
|
|
|
|
Hi,
im using the below code to increase the size of the DialogBox along with the controls inside it during Runtime...ie im overriding DoModal()function...
CTestDlg is my application name....
INT_PTR CTestDlg::DoModal()
{
CDialogTemplate dlt;
int nResult;
// load dialog template
//CTestDlg::IDD is the ID of my resoource...
if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1;
// set your own font, for example "Arial", 10 pts.
dlt.SetFont(L"Arial", 12);
// get pointer to the modified dialog template
LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);
// let MFC know that you are using your own template
m_lpszTemplateName = NULL;
InitModalIndirect(pdata);
// display dialog box
nResult = CDialog::DoModal();
// unlock memory object
GlobalUnlock(dlt.m_hTemplate);
return nResult;
}
The issue is the font of one of the control (CheckBox) is not getting increased...
Please let me know...
|
|
|
|
|
Hi All,
i know it might be a basic question but still i have to ask as i didnt find it that how i can replace " with \"
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
If you are trying to insert a backslash using a string literal you need to escape the character. The escape character is of course a backslash so that means you need two consecutive to produce one.
"\\"
Otherwise I have no idea what you are trying to do.
|
|
|
|
|
You can use CString::Replace or string::find and string::replace.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I'm not a C++ programmer, but I have some work to do with fixing a Memory Leak. I created a reference to an object called myObject:
myObject = CreateObject();
right?
So if I recreate that myObject by using:
myObject = CreateObject();
Again and it creates a new object will it overwrite that memory space and destroy the old object or do I have to delete myObject first and then write to that reference again?
Thanks for your help, I've been looking everywhere for this.
|
|
|
|
|
You have to delete the previously created object before creating a new object.
If you have used new or new[] inside CreateObject you have to call delete or delete[] respectively.
If malloc is used, you have to call free.
If it is a COM object, you have to call its Release method.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
It all depends on what CreateObject actually does...
If it does something like this:
struct Object
{
whatever
};
Object CreateObject() { return Object(); }
then you don't need to do anything to myObject before reassigning to it.
If it uses a resource allocating function (e.g. new and malloc allocate memory, CreateFile, CreateEvent and CreateProcess allocate kernel handles, there are many more different examples of resource allocators) and passes control of that resource back to you, then you are responsible for deallocating that resource.
To show a simple example:
Object* CreateObject() { return new Object(); }
To reassign to myObject, you'd need to deallocate the thing referenced by myObject using delete myObject
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
just to clarify :
does CreateObject() return a pointer to an object or a reference ?
This signature was proudly tested on animals.
|
|
|
|
|
It's just simply:
{return new Object();}
|
|
|
|
|
In which case a delete myObject; is required to deallocate the object before assigning a different value to myObject - so long as the reference held by myObject hasn't been copied to some other variable.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
No ,this will not overwrite the Memory Space.
if you have created object and collected the Reference it's just a reference (i.e. constant pointer).If you will assign it a new address it 'll not delete old object.(As it should not, Bcoz that object may be used ant where else).So if you are sure it is not usable now.Then call delete on it first .Then create new and assign value to it.
But if you are not assigning new value , set it to null ('ll save from Dangling pointer).
So you can say
if( myObject != NULL)
delete myObject;
myObject = CreateObject(); //or myObject = NULL;
It's not enough to be the best, when you have capability to be great....
|
|
|
|
|
Dear All,
I want to display Unicode characters in my CEdit control but it is not displaying and it is displaying as boxes. Any ideas ?
Bhanu
|
|
|
|
|
Is your project set to build for unicode?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I am using the ShellExecute API to launch default E-mail client like "emailto:Email Ids". It is working well but when the number of characters exceed 1852, its not launching the E-mail client. The API is still returning success code only. My default mail client is Mozilla thunderbird. Is this a restriction in the API or any chance for E-mail client?
Thanks
--
"Programming is an art that fights back!"
|
|
|
|
|
rp_suman wrote: number of characters exceed 1852, its
Number of characters of what?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Are you by any chance running Win2k or earlier?
This article[^] may be of interest. The resulting command line may exceed 2047 chars.
However, I personally find an email address that exceeds 1852 chars to be rather uncommon.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
The field can have more than one E-mail, so it may exceed 1852 occasionally. I checked same thing in system with outlook/Win XP the max limit was 1863.
--
"Programming is an art that fights back!"
|
|
|
|
|
Roger Stoltz wrote: However, I personally find an email address that exceeds 1852 chars to be rather uncommon.
Should be rather OK as long as you don't have to spell your email ID out to someone over the phone.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I'm assuming that you are clubbing too many email ids separated by semicolons? I tried by increasing the no. of email ids with every trial. At some point, ShellExecute started returning a value NOT greater than 32 (it returns a value greater than 32 if it succeeds) and the return value was, upon failure, SE_ERR_ACCESSDENIED .
You might want to check the return value properly.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I think it has to do with the lenght of the commandline. What you could do is put your line in a batchfile (just generate the file from within your program) and run that one. Just delete it when ready..
Rozis
|
|
|
|