3,245
社区成员
发帖
与我相关
我的任务
分享
STDMETHODIMP CCapCon::get_strDevice(BSTR *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
*pVal = m_strDevice;
return S_OK;
}
STDMETHODIMP CCapCon::put_strDevice(BSTR newVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
m_strDevice = newVal;
return S_OK;
}
MyControl.strDevice = textBox1.Text;
MyControl.Start();
STDMETHODIMP CAtl::get_Str(BSTR *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
*pVal = m_str.AllocSysString();
return S_OK;
}
[System.Runtime.InteropServices.DllImportAttribute("oleaut32.dll", EntryPoint = "SysAllocString")]
[return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.BStr)]
public static extern string SysAllocString( [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] string param0);
[System.Runtime.InteropServices.DllImportAttribute("oleaut32.dll", EntryPoint = "SysFreeString")]
public static extern void SysFreeString([System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.BStr)] string param0);