3,245
社区成员
发帖
与我相关
我的任务
分享
// ContainerDlg 对话框
class ContainerDlg : public CDialog
{
DECLARE_DYNAMIC(ContainerDlg)
public:
ContainerDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~ContainerDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG1 };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CDctlctrl1 dctl; //生成的控件对象
};
class CDctlctrl1 : public CWnd
{
protected:
DECLARE_DYNCREATE(CDctlctrl1)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x22842328, 0x3FCE, 0x11D1, { 0x9B, 0x93, 0x0, 0x20, 0xAF, 0x52, 0x4F, 0xA5 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID);
}
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey);
}
// 特性
//以为枚举和接口代码,只贴出了一个
long GetLastError()
{
long result;
GetProperty(0xa, VT_I4, (void*)&result);
return result;
}
BOOL Driver::OpenLink()
{
CString str = "DDeserver";
CString str1 = containerdlg->dctl.GetLinkTopic();//函数能调用成功,但是函数执行中返回异常返回异常
return 0;
}
CString GetLinkTopic()
{
CString result;
GetProperty(0x3, VT_BSTR, (void*)&result);//每次这个地方报Debug Assertion Failed的异常
return result;
}