Is the above possible?
Can I do this:
IUnknown *punk;
punk->QueryInterface(IID_MyInterface, (void**)&m_pMyInterface);
I thought that this would tell me if the MyInterface is supported m_pMyInterface…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you really mean what you’ve written above, then no: because your
punkis an uninitialized pointer.Normally you need to call
CoCreateInstanceto create an instance of something; after that you can callQueryInterfaceon that instance, to ask what interface[s] it supports.