🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

COM interface pointer wrapping

posted in IfThen Software
Published May 27, 2011
Advertisement
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/
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement