2025-04-27 07:49:33 -04:00

226 lines
9.4 KiB
HTML
Raw Permalink Blame History

<!- Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved ->
<!doctype html public "-//W3C//DTD HTML 4.0 Draft//EN">
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1251">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./snapin_files/filelist.xml">
<title>WMI SDK Sample - Client</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Michael Maston</o:Author>
<o:Template>Normal</o:Template>
<o:LastAuthor>Michael Maston</o:LastAuthor>
<o:Revision>67</o:Revision>
<o:TotalTime>185</o:TotalTime>
<o:Created>1999-01-25T00:44:00Z</o:Created>
<o:LastSaved>2001-01-20T21:42:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>319</o:Words>
<o:Characters>1820</o:Characters>
<o:Company>Microsoft</o:Company>
<o:Lines>15</o:Lines>
<o:Paragraphs>3</o:Paragraphs>
<o:CharactersWithSpaces>2235</o:CharactersWithSpaces>
<o:Version>9.2720</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:Zoom>103</w:Zoom>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-alt:"MS Mincho";
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:black;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;
text-underline:single;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->
<meta name=MS-HAID content=VJsamples>
</head>
<body bgcolor=white lang=EN-US link=blue vlink=blue style='tab-interval:.5in'>
<div class=Section1>
<table border=0 cellpadding=0 width="100%" style='width:100.0%;mso-cellspacing:
1.5pt;mso-padding-alt:0in 0in 0in 0in'>
<tr>
<td width=160 style='width:120.0pt;background:#330099;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Verdana;
color:white'>&nbsp;<nobr><b>Windows Management Instrumentation SDK Sample</b></span>
<o:p></o:p></p>
</td>
</tr>
</table>
<p class=MsoPlainText><br>
<strong><span style='font-size:13.5pt;font-family:Verdana'>Snap-in</span></strong><br>
<br>
<span style='font-family:Verdana;mso-fareast-font-family:"MS Mincho";
mso-bidi-font-family:"Times New Roman"'>The Snap-in sample demonstrates how to
get started with a WMI-enabled MMC snap-in.<span style="mso-spacerun: yes"><EFBFBD>
</span>To make it easier for the key design factors to be seen, this sample is kept
to absolute minimal features and assumes that you have already built and
understand the concepts from Advanced Client and Consumer samples. It also
assumes that you are familiar with general snap-in programming and you only
need to see the two technologies together.<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana;mso-fareast-font-family:
"MS Mincho";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana;mso-fareast-font-family:
"MS Mincho";mso-bidi-font-family:"Times New Roman"'>This sample is a standalone
snap-in without remoting capability. The code is designed to be easy to follow
and doesn't necessarily show a good practice for building 'real' WMI-enabled
snap-ins. Concentrate on the steps and architect your snap-in in a way that
makes sense for you. Use the Advanced Client sample to add office equipment
instances to the SAMPLE_Office namespace before running this sample.<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana;mso-fareast-font-family:
"MS Mincho";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana;mso-fareast-font-family:
"MS Mincho";mso-bidi-font-family:"Times New Roman"'>If this snap-in is
displaying office equipment instances when you use the Client sample to add
more equipment, a WMI Temporary Event setup by the snap-in will trigger a
refresh of this list.<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana;mso-fareast-font-family:
"MS Mincho";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
font-family:Verdana'>Building the Snap-in<o:p></o:p></span></p>
<p class=MsoPlainText>&nbsp;</p>
<p class=MsoPlainText><span style='font-family:Verdana'>The application can be
built from the command line using NMAKE, or it can be built using Microsoft
Visual C++.<span yes>&nbsp; </span>You must also have the Platform SDK
installed since this sample uses the latest MMC 1.2 definitions.<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana'>&nbsp;<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana'>From the command line
in the sample installation directory: <o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana'>&nbsp;<o:p></o:p></span></p>
<p class=MsoPlainText style='margin-left:.25in'><b><span style='font-family:
Verdana'>NMAKE /f &quot;Makefile&quot;<o:p></o:p></span></b></p>
<p class=MsoPlainText><span style='font-family:Verdana'>&nbsp;<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana'>From Microsoft Visual
C++: <o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana'>&nbsp;<o:p></o:p></span></p>
<p class=MsoPlainText l0 level1 lfo2 list .5in><span style='font-family:Verdana'>1.<span
Times New Roman></span></span><span style='font-size:7.0pt;font-family:Verdana'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-family:Verdana'>Select File + Open Workspace<o:p></o:p></span></p>
<p class=MsoPlainText l0 level1 lfo2 list .5in><span style='font-family:Verdana'>2.<span
Times New Roman></span></span><span style='font-size:7.0pt;font-family:Verdana'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-family:Verdana'>Select the snapin.dsp file. Change the
file filter if necessary to see this file.<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana;mso-fareast-font-family:
"MS Mincho";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt;
font-family:Verdana'>Running the Snap-in<o:p></o:p></span></p>
<p class=MsoPlainText><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
<p class=MsoPlainText><span style='font-family:Verdana'>If you build the
snap-in from Visual C++ using the dsp file, it is automatically registered as a
snap-in. If you used the NMAKE makefile, you must manually register it using
regsvr32.exe. <o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-family:Verdana'>Once the snap-in
registered, you can add it to an MMC toolset by using the <20>Add/Remove Snap-in<69>
menu item in MMC to add the <20>Office Equipment<6E> standalone snap-in. For
simplicity, the snap-in only displays Office Equipment already in the sample
namespace.<o:p></o:p></span></p>
<p class=MsoNormal style='tab-stops:list .5in'><span style='font-family:Verdana'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='tab-stops:list .5in'><span style='font-family:Arial'><a
href="http://www.microsoft.com/misc/CPYRIGHT.HTM"><span style='mso-field-code:
"HYPERLINK \0022http\:\/\/www\.microsoft\.com\/misc\/CPYRIGHT\.HTM\0022"'><b><EFBFBD>
1998-2001 Microsoft Corporation. All rights reserved.</b></span></a></span></p>
</div>
</body>
</html>