Win95 , VC5.0
Now I want to get the interface(DUAL IDispatch) a OCX Control
which made by myself. I add it to a dialog and it can show normally.
I write sources in OnOK() button on Click like below:
//*********************
HRESULT hr;
IDispatch *pDispatch;
CWnd* pControlWnd;
// Get CWnd of the OCX Control in Dialog
pControlWnd=this->GetDlgItem(IDC_CCPCBUTTONCTRL1);
// Get the iDispatch interface of the OCX Control
pDispatch = (IDispatch *)pControlWnd->GetControlUnknown();
// Get the Dual Interface defined by me
hr = pDispatch->QueryInterface(IID_ICCPCButton, (PVOID *)g_pButton);
//********************
Error happened in
hr = pDispatch->QueryInterface(IID_ICCPCButton, (PVOID *)g_pButton);
VC5.0 show that I access a illegal address.
I think that the OCX control has a HWND but not has a instance.
How can make the instance with the OCX control using SDK?
Thanks in advance
Huang Lei