OLEVIEW 示例:ActiveX 对象查看器

更新:2007 年 11 月

OLEVIEW 示例阐释如何通过自定义 ActiveX 接口来实现 ActiveX 对象查看器。这些自定义接口是在 Iviewers.dll 中实现的。

说明:

某些示例(如此示例)尚未经过修改以反映 Visual C++ 向导、库和编译器中所做的更改,但仍演示了如何完成所需的任务。

安全说明:

提供该示例代码是为了阐释一个概念,并不代表着最安全的编码实践,因此不应在应用程序或网站中使用该示例代码。对于超出本示例代码的预期用途以外的使用所造成的偶然或继发性损失,Microsoft 不承担任何责任。

获取示例和安装示例的说明:

  • 在 Visual Studio 的“帮助”菜单上,单击“示例”。

    有关更多信息,请参见定位示例文件

  • 示例的最新版本和完整列表可以从 Visual Studio 2008 Samples page(Visual Studio 2008 示例页面)联机获取。

  • 还可以在计算机的硬盘上查找示例。默认情况下,示例和自述文件将复制到 \Program Files\Visual Studio 9.0\Samples\ 下的文件夹中。对于 Visual Studio 速成版,所有示例都位于联机位置。

生成并运行示例

生成并运行 OLEVIEW 示例

  1. 打开解决方案 oleview.sln。

  2. 在“生成”菜单中单击“生成”。

应用程序具有含两个窗格的 SDI 界面。左窗格使您可以通过树控件浏览注册表。一旦选择一个节点后,右窗格将显示相关信息。

请注意,该示例应用程序无法显示所有对象的信息,而是仅显示支持 IViewer 接口的对象的信息。

关键字

此示例说明以下关键字:

AfxGetInstanceHandle;AfxMessageBox;AfxOleInit;AfxThrowMemoryException;AfxThrowOleException;BitBlt;CBitmap::CreateBitmap;CBitmap::LoadBitmap;CBrush::CreateSolidBrush;CCmdTarget::BeginWaitCursor;CCmdTarget::EndWaitCursor;CDC::Attach;CDC::BitBlt;CDC::CreateCompatibleDC;CDC::DeleteDC;CDC::Detach;CDC::GetPixel;CDC::GetTextMetrics;CDC::SelectObject;CDialog::DoModal;CDialog::OnInitDialog;CDocument::OnCloseDocument;CDocument::OnNewDocument;CDocument::UpdateAllViews;CFileDialog::DoModal;CFileDialog::GetPathName;CFont::CreateFontIndirect;CFrameWnd::Create;CFrameWnd::GetActiveDocument;CFrameWnd::LoadFrame;CFrameWnd::OnCreateClient;CFrameWnd::SetActiveView;CGdiObject::DeleteObject;CListBox::SetCurSel;CObject::AssertValid;CObject::Dump;CRect::Height;CRect::Width;CScrollView::SetScrollSizes;CSplitterWnd::CreateStatic;CSplitterWnd::CreateView;CSplitterWnd::GetColumnInfo;CSplitterWnd::GetPane;CSplitterWnd::SetColumnInfo;CStatic::SetIcon;CString::Format;CString::GetBuffer;CString::IsEmpty;CString::LoadString;CString::ReleaseBuffer;CView::GetDocument;CView::OnDragEnter;CView::OnDragLeave;CView::OnDragOver;CView::OnDrop;CView::OnInitialUpdate;CView::OnUpdate;CWinApp::AddDocTemplate;CWinApp::ExitInstance;CWinApp::InitInstance;CWinApp::OnFileNew;CWinApp::SetRegistryKey;CWnd::DoDataExchange;CWnd::DragAcceptFiles;CWnd::GetParent;CWnd::GetSafeHwnd;CWnd::GetStyle;CWnd::GetWindowPlacement;CWnd::GetWindowRect;CWnd::OnCreate;CWnd::OnDestroy;CWnd::OnSize;CWnd::OnSysColorChange;CWnd::ScreenToClient;CWnd::SetFocus;CWnd::SetFont;CWnd::SetRedraw;CWnd::SetWindowPlacement;CWnd::SetWindowPos;CWnd::SetWindowText;CWnd::ShowWindow;ClientToScreen;CoCreateInstance;CoFreeUnusedLibraries;CoGetClassObject;CoGetMalloc;CreateSolidBrush;DeleteItem;DeleteObject;EnumFontFamilies;ExtTextOut;ExtractIcon;FormatMessage;FreeLibrary;FreeProcInstance;GetBkColor;GetClientRect;GetDC;GetDeviceCaps;GetNearestColor;GetObject;GetParent;GetProcAddress;GetProfileInt;GetProfileString;GetStockObject;GetSysColor;GetSystemMetrics;GetTextExtentPoint;GetTextMetrics;GetUserDefaultLCID;GetVersionEx;GetWindowLong;GetWindowRect;IClassFactory::CreateInstance;IMalloc::Free;IUnknown::QueryInterface;IUnknown::Release;IsWindow;LoadBitmap;LoadIcon;LoadLibrary;LoadLibraryEx;LocalFree;MAKEINTRESOURCE;MakeProcInstance;MulDiv;OffsetRect;Polygon;RGB;RectVisible;RegCloseKey;RegEnumKey;RegOpenKey;RegQueryValue;ReleaseDC;SelectObject;SetBkColor;SetTextColor;SetWindowPos;TabbedTextOut;WinExec;WinHelp;WriteProfileString;_fstrnicmp;atoi;isdigit;isspace;isxdigit;lstrcat;lstrcmpi;lstrcpy;lstrlen;max;strrchr;toupper;wsprintf

请参见

其他资源

MFC 示例