Jump to content
  • Advertisement
  • entries
  • comments
  • views

COM interface pointer wrapping

Sign in to follow this  


Today I created the repository for the new test project and started on the framework.

One of the things I want to try out in this project is a better wrapper around COM interfaces. Previously, each interface had its own wrapper class which handled creation of the associated object, as well as destruction. This was a bit difficult to work with though, and caused the code to look like "m_dev->m_dev->Present()".

The new wrapper I am going to try out will be generic by way of a template. One really nice thing about this new design is that I will be able to pass the wrapper directly to a function which is expecting a normal COM interface pointer. This will be done by overloading the address-of operator to return the address of the interface pointer being wrapped. With the old design I had to make such calls inside of the wrapper, which lead to some really rigid code.

Another thing I will be looking into is hooking the window to process input messages separate from the windowing code. I have never liked having the WM_KEYDOWN message processing inside of the window manager.

Reposted from http://invisiblegdev.blogspot.com/
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!