In the ATL ActiveX control, I created a property page that inherits from COlePropertyPage and wrote the CLSID into the control’s IDL. I used the macro PROP_PAGE to bind the CLSID of this property page.
In the OnProperties function, the CLSID of the property page is created in the following way, but the property page is not displayed when the control is run. I want to know where the error is.
STDMETHODIMP CATLActiveXCtl::ShowPropertyPages(void)
{
CLSID aCLSIDs[1];
memcpy_s(&(aCLSIDs[0]), sizeof(CLSID), &CLSID_Tab1, sizeof(CLSID));
CComPtr<IUnknown> pUnk;
QueryInterface(IID_IUnknown, (void**)&pUnk);
return OleCreatePropertyFrame(
m_hWnd,
0,
0,
L"ATLActiveX Properties",
1,
&(pUnk.p),
1,
aCLSIDs,
GetThreadLocale(),
0,
NULL);
}
I originally wanted to create a BCGPGridList in the property page of ATL ActiveX, but found that it could not receive messages such as WM_MouseMove. Later, I tried to change the ATL Property Page to a class that inherits COlePropertyPage, but I found that the property page could not be displayed.