Article ID: 196837
Article Last Modified on 10/24/2003
SAFEARRAY(type) pSA SAFEARRAY(type) *ppSA
STDMETHOD(Test)(SAFEARRAY(BSTR) *ppArrayBstr); STDMETHOD(Test2)(SAFEARRAY(BSTR) pArrayBstr);The correct declarations for header file should be:
STDMETHOD(Test)(SAFEARRAY **ppArrayBstr); STDMETHOD(Test2)(SAFEARRAY *pArrayBstr);The correct definitions for source file should be:
STDMETHODIMP CATLObj::Test(SAFEARRAY **ppArrayBstr)
{
return S_OK;
}
STDMETHODIMP CATLObj::Test2(SAFEARRAY *pArrayBstr)
{
return S_OK;
}
You will notice that if you use the above method, the Class view
information in the Tree view may look different for CATLObj. Test and Test2
will not be in the IATLObj interface section in Class view for CATLObj as
they were before. They are now in the member function section. You can
correct this behavior by not making the changes above; and instead, using a
macro. To do this, make the following modifications to the header file
before the class definition:
#define SAFEARRAY(X) SAFEARRAY*Class view will now properly display the new methods under the interface section instead of under the member function section.
[out] SAFEARRAY(BSTR) *pArrayBSTR
Keywords: kbbug kbautomation kbwizard kbcollectionclass KB196837