以下是引用片段: namespace test { __gc public class testDocObject : public Object { public: testDocObject(void) { } }; } |
以下是引用片段: public: gcroot<test::testDocObject*> m_ptestDocObj; |
以下是引用片段: BOOL CtestDoc::InitialDocument() { #PRagma push_macro("new") #undef new m_ptestDocObj = new test::testDocObject(); #pragma pop_macro("new") } |
以下是引用片段: class CWFControlWrapper : public CWnd { public: CWFControlWrapper(); virtual ~CWFControlWrapper(void); IUnknown *pUnkControl; IUnknown *GetManagedControl() { return pUnkControl; } void SetControlSite(COleControlSite *pSite) { m_pCtrlSite = pSite; } }; |
以下是引用片段: BOOL CUserCtrlView::PreTranslateMessage(MSG *pMsg) { BOOL bRet = FALSE; if(m_Control.pUnkControl != NULL) { CComQiptr<IOleInPlaceActiveObject> spInPlace(m_Control.pUnkControl); if(spInPlace) bRet =(S_OK == spInPlace-> TranslateAccelerator(pMsg)) ? TRUE : FALSE; } if(CView::PreTranslateMessage(pMsg)) return TRUE; CFrameWnd *pFrameWnd = GetTopLevelFrame(); if(pFrameWnd != NULL && pFrameWnd->m_bHelpMode) return FALSE; // start with first parent frame pFrameWnd = GetParentFrame(); while(pFrameWnd != NULL) { if(pFrameWnd->PreTranslateMessage(pMsg)) return TRUE; pFrameWnd = pFrameWnd->GetParentFrame(); } return bRet; } |
以下是引用片段: #pragma once ... namespace test { public __gc class testControl : public System::Windows::Forms::UserControl { public: testControl(void) { InitializeComponent(); } protected: void Dispose(Boolean disposing) { if(disposing && components) components->Dispose(); __super::Dispose(disposing); } private: System::Windows::Forms::Label *label1; System::ComponentModel::Container *components; void InitializeComponent(void) { this->label1 = new System::Windows::Forms::Label(); this->SuspendLayout(); this->label1->Location = System::Drawing::Point(16, 24); this->label1->Name = S"label1"; this->label1->Size = System::Drawing::Size(208, 16); this->label1->TabIndex = 0; this->label1->Text = S"Welcome to TZ MFC.NET!"; this->Controls->Add(this->label1); this->Name = S"testControl"; this->Size = System::Drawing::Size(240, 160); this->ResumeLayout(false); } }; } |
新闻热点
疑难解答