The scope of that question is far to large to discuss in a forum which is why I referred you to other sources. However a quick couple of points I will provide are; 1) your notion of calling the base class method after the Bar method. Notice in my posted example the base class is called first. That is because in your posted code the Bar method frees the memory.
void DoSomething(void *p)
Calling the Foo method after that would result in the Foo method having an invalid pointer.
2) Also using void pointers is NOT Best Practice. Strongly Typed code is preferable.
Anyway all of these types of problems are covered in materials such as the ones I pointed you at. How do you think I know about them? I didn't invent anything you know, I learned from others.
The second problem is simply a problem with my example. I was in rather a rush, so apologies for causing the misunderstanding. I hadn't thought about the first problem though. You're right; the base class' method should be called first. But is there any way to make this call implicit?
Not sure how to respond to that. If you have to do something to make it happen then it can't be implicit can it? If they made that implicit, then you would have to do something to eliminate the base being called. It seems the current way is more obvious therefore easier to understand, yes?
What I mean is this. Normally, when the derived class' method is called, the base class' method is not. What I'm looking for is how to make the base' class method be called, and then the derived class' method
Example: I call Bar->DoSomething((void *)0x12345), the parameters are pushed onto the thread's stack, and Bar::DoSomething is invoked. I want the parameters to be pushed, Foo::DoSomething to be called (the base class) and then Bar::DoSomething to be called (the derived class) automatically
If it helps, a little background. I have a Stream base class. It has a LinkedStream property, which refers to a Stream pointer. When I call Stream::Write, I want to call LinkedStream->Write beforehand, then pass the arguments to the derived class' write method
I want the parameters to be pushed, Foo::DoSomething to be called (the base class) and then Bar::DoSomething to be called (the derived class) automatically
Then write your own language and compiler that will do that I guess. I terms of C++ it's like you are saying you want up to be down. That's just to bad for you because it isn't, period.
However I would also point out that it seems you are making a big deal out of nothing. In your background explanation with streams, if your derived class just calls the base first it results in the runtime behavior you describe.
I've got a few extensions I need to add to the registry so when the user is exploring via windows explorer they will see a default icon I've created for the extensions. I've already created a script to register the 'display description' (ie: '.htm' file extensions are described with 'HTML Document'). That, I have working.
What keys do I need to create in order for an icon to be displayed for the file. (By default, the 'Unknown Document' is shown.) I want to display my own icon. All the sites I've explored during my research only mention how to change existing registry entries.
I need a .reg file because the app is going to be deployed.
Will I need to create a CLSID or use one from the App that has been created? I'm thinking I'm going to need 2 or 3 registry entries in order to get this to work but I don't know where to start.
You are not using the assert properly. This function should be used only to test the code. An assert should never be reached in a released product. Assert is used to detect errors in your code, not detect a file which is missing. In your case, if the file doesn't not exist you should handle the error in a better way. For instance your function could return an error code or throw an exception which has to be handled at a higher level.