亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch15.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
string table there, click IDR_SHOWSTTYPE once to highlight it, and choose View, Properties
(or double-click the string). This string is saved in the document template when
a new one is constructed in CShowStringApp::InitInstance(), like this:</P>
<P>
<H4>Listing 15.12&#160;&#160; ShowString.cpp--Excerpt from ShowStringApp::InitInstance()</H4>
<PRE>     pDocTemplate = new CMultiDocTemplate(
          IDR_SHOWSTTYPE,
          RUNTIME_CLASS(CShowStringDoc),
          RUNTIME_CLASS(CChildFrame), // custom MDI child frame
</PRE>
<PRE>          RUNTIME_CLASS(CShowStringView));
</PRE>
<P>The caption of the menu resource holds seven strings, and each is used by a different
part of the framework. They are separated by the newline character \n. The seven
strings, their purposes, and the values provided by AppWizard for ShowString are
as follows:</P>
<P>

<UL>
	<LI><B>Window Title--</B>Used by SDI apps in the title bar. For ShowString: not provided.
	<P>
	<LI><B>Document Name--</B>Used as the root for default document names. For ShowString:
	ShowSt, so that new documents will be ShowSt1, ShowSt2, and so on.
	<P>
	<LI><B>File New Name--</B>Prompt in the File New dialog box for file type. (For example,
	in Developer Studio there are eight file types, including Text File and Project Workspace.)
	For ShowString: ShowSt.
	<P>
	<LI><B>Filter Name--</B>An entry for the drop-down box Files of Type in the File
	Open dialog box. For ShowString: not provided.
	<P>
	<LI><B>Filter Extension--</B>The extension that matches the filter name. For ShowString:
	not provided.
	<P>
	<LI><B>Registry File Type ID--</B>A short string to be stored in the Registry. For
	ShowString: ShowString.Document.
	<P>
	<LI><B>Registry File Type Name--</B>A longer string that shows in dialog boxes involving
	the Registry. For ShowString: ShowSt Document.
</UL>

<P>Look again at Figure 15.5 and you can see where these values came from. Try changing
the last entry. In the Properties dialog box, change the caption so that the last
element of the string is ShowString Document and press Enter. Build the project.
Run it once and exit. In the output section of Developer Studio, you see these messages:</P>
<P>
<PRE>Warning: Leaving value `ShowSt Document' for key `ShowString.Document'
 in registry
 intended value was `ShowString Document'.
Warning: Leaving value `ShowSt Document' for key
 `CLSID\{0B1DEE40-C373-11CF-870C-00201801DDD6}' in registry
 intended value was `ShowString Document'.
</PRE>
<P>This means that the call to UpdateRegistry() did not change these two keys. There
is a way to provide parameters to UpdateRegistry() to insist that the keys be updated,
but it's even more complicated than the route you will follow. Because no code has
been changed from that provided by AppWizard, it's much quicker to delete the ShowString
directory and create it again, this time setting the long file type to ShowString
Document.</P>
<P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>CAUTTION:</strong><B> </B>Always test AppWizard-generated code before you add changes
	of your own. Until you are familiar with every default you are accepting, it is worth
	a few moments to see what you have before moving on. Rerunning AppWizard is easy,
	but if you've made several hours worth of changes and then decide to rerun it, it's
	not such a simple task.
<HR>


</BLOCKQUOTE>

<P>Close Visual Studio, delete the ShowString folder entirely, and generate a new
application with AppWizard as before. This time, in Step 4, click the Advanced button
and change the file type names as shown in Figure 15.6. After you click Finish, AppWizard
asks whether you wish to reuse the existing CLSID, as shown in Figure 15.7. Click
Yes and then OK to create the project. This makes a new showstring.reg file for you
with the correct Registry values.</P>
<P><A HREF="javascript:popUp('15uvc06.gif')"><B>FIG. 15.6</B></A><B> </B><I>The Advanced
Options dialog box of Step 4 of AppWizard is the place to improve the file type names.</I></P>

<P><A HREF="javascript:popUp('15uvc07.gif')"><B>FIG. 15.7</B></A><B> </B><I>AppWizard
makes sure that you don't accidentally reuse a CLSID.</I></P>

<P>This changes the string table as well as the showstring.reg file, so you might
be tempted to build and run the application to make this fix complete. It's true,
when you run the application, it will update the Registry for you, using the values
from the new string table. Alas, the registration update will fail yet again. If
you were to try it, these messages would appear in the output window:</P>
<P>
<PRE>Warning: Leaving value `ShowSt Document' for key
 `ShowString.Document' in registry
 intended value was `ShowString Document'.
Warning: Leaving value `ShowSt Document' for key
 `CLSID\{0B1DEE40-C373-11CF-870C-00201801DDD6}' in registry
 intended value was `ShowString Document'.
Warning: Leaving value `ShowSt' for key
 `CLSID\{0B1DEE40-C373-11CF-870C-00201801DDD6}\AuxUserType\2'
 in registry
 intended value was `ShowString'.
</PRE>
<P>So, how do you get out of this mess? You have to edit the Registry. If that doesn't
sound intimidating, it should. Messing with the Registry can leave your system unusable.
But you are not going to go in by hand and change keys; instead, you are going to
use the Registry file that AppWizard generated for you. Here's what to do:</P>
<P>

<DL>
	<DD><B>1. </B>Choose Start, Run.
	<P>
	<DT></DT>
	<DD><B>2. </B>Type <B>regedit</B> and press Enter.
	<P>
	<DT></DT>
	<DD><B>3. </B>Choose Registry, Import Registry File from the Registry Editor menu.
	<P>
	<DT></DT>
	<DD><B>4. </B>Using the Import Registry File dialog box, move through your folders
	until you reach the one where the replacement ShowString server was just generated
	by AppWizard, as shown in Figure 15.8. Click Open.
	<P>
	<DT></DT>
	<DD><B>5. </B>A success message is shown. Click OK.
	<P>
	<DT></DT>
	<DD><B>6. </B>Close the Registry Editor.
	<P>
</DL>

<P><A HREF="javascript:popUp('15uvc08.gif')"><B>FIG. 15.8</B></A><B> </B><I>Registry
files generated by AppWizard have the extension .reg.</I></P>

<P><I><BR>
</I>Now if you run ShowString again, those error messages don't appear. Run Word
again and choose Insert, Object. The Object dialog box now has a more meaningful
ShowString entry, as shown in Figure 15.9.</P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE:</strong> There are three morals to this side trip. The first is that you should
	think really carefully before clicking Finish on the AppWizard dialog box. The second
	is that you cannot ignore the Registry if you are an ActiveX programmer. The third
	is that anything can be changed if you have the nerve for it.&#160;
<HR>


</BLOCKQUOTE>

<P>Click OK on the Object dialog box to insert a ShowString object into the Word
document. You can immediately edit it in place, as shown in Figure 15.10. You can
see that the combined server and container in-place menus are being used. There's
not much you can do to the embedded object at this point because the ShowString code
that actually shows a string has not been added. Press Esc to finish editing in place,
and the menus return to the usual Word menus, as shown in Figure 15.11.</P>
<P><A HREF="javascript:popUp('15uvc09.gif')"><B>FIG. 15.9</B></A><B> </B><I>The updated
long file type name appears in the Object dialog box of other applications.</I></P>

<P><A HREF="javascript:popUp('15uvc10.gif')"><B>FIG. 15.10</B></A><B> </B><I>While
editing in place, the in-place menus replace the Word menus.</I></P>

<P><A HREF="javascript:popUp('15uvc11.gif')"><B>FIG. 15.11</B></A><B> </B><I>When
the object is inactive, Word reminds the user of the object type.</I></P>

<P>Although this server doesn't do anything, it is a perfectly good server. You can
resize and move the embedded item while it is active or inactive, and everything
operates exactly as you expect. All that remains is to restore the ShowString functionality.</P>
<P>
<H3><A NAME="Heading3"></A>Showing a String Again</H3>
<P>As you did in Chapter 14, it is time to add the ShowString functionality to this
version of the program. If you went through this process before, it will be even
quicker this time. Remember to open the ShowString files from Chapter 8, so that
you can copy code and resources from the functional ShowString to the do-nothing
ActiveX server you have just created and explored. (If you didn't code along in Chapter
8, you can get the completed code on the Web at <A target="_new" HREF="http://www.mcp.com/info"><B>www.mcp.com/info</B></A>
or <A target="_new" HREF="http://www.gregcons.com/uvc6.htm"><B>www.gregcons.com/uvc6.htm</B></A>.)
Here's what to do:</P>
<P>

<DL>
	<DT></DT>
	<DD><B>1. </B>In ShowStringDoc.h, add the private member variables and public Get
	functions to the class.
	<P>
	<DT></DT>
	<DD><B>2. </B>In CShowStringDoc::Serialize(), paste in the code that saves or restores
	these member variables.
	<P>
	<DT></DT>
	<DD><B>3. </B>In CShowStringDoc::OnNewDocument(), paste in the code that initializes
	the member variables. Change the default values of horizcenter and vertcenter to
	FALSE. You'll see why towards the end of the chapter.
	<P>
	<DT></DT>
	<DD><B>4. </B>Copy the entire Tools menu from the old ShowString to the new server
	ShowString. Choose File, Open to open the old ShowString.rc, open the IDR_SHOWSTTYPE
	menu, click the Tools menu, and choose Edit, Copy. Open the new ShowString's IDR_SHOWSTTYPE
	menu, click the Window menu, and choose Edit, Paste.
	<P>
	<DT></DT>
	<DD><B>5. </B>Paste the Tools menu into the IDR_SHOWSTTYPE_SRVR_IP (before the separator
	bars) and IDR_SHOWSTTYPE_SRVR_EMB menus in the same way.
	<P>
	<DT></DT>
	<DD><B>6. </B>Add the accelerator Ctrl+T for ID_TOOLS_OPTIONS as described in Chapter
	8. Add it to all three accelerators.
	<P>
	<DT></DT>
	<DD><B>7. </B>Delete the IDD_ABOUTBOX dialog box from the new ShowString. Copy IDD_ABOUTBOX
	and IDD_OPTIONS from the old ShowString to the new.
	<P>
	<DT></DT>
	<DD><B>8. </B>While IDD_OPTIONS has focus, choose View, ClassWizard. Create the COptionsDialog
	class as in the original ShowString.
	<P>
	<DT></DT>
	<DD><B>9. </B>Use ClassWizard to arrange for CShowStringDoc to catch the ID_TOOLS_OPTIONS
	command.
	<P>
	<DT></DT>
	<DD><B>10. </B>In ShowStringDoc.cpp, replace the ClassWizard version of CShowStringDoc::OnToolsOptions()
	with the one that puts up the dialog box.
	<P>
	<DT></DT>
	<DD><B>11. </B>In ShowStringDoc.cpp, add <B>#include &quot;OptionsDialog.h&quot;</B>
	after the #include statements already present.
	<P>
	<DT></DT>
	<DD><B>12. </B>Use ClassWizard to connect the dialog box controls to COptionsDialog
	member variables as before. Connect IDC_OPTIONS_BLACK to m_color, IDC_OPTIONS_HORIZCENTER
	to m_horizcenter, IDC_OPTIONS_STRING to m_string, and IDC_OPTIONS_VERTCENTER to m_vertcenter.
	<P>
</DL>

<P>To confirm you've made all the changes correctly, build the project--there should
be no errors.</P>
<P>You haven't restored CShowStringView::OnDraw() yet because there are actually
going to be two OnDraw() functions. The first is in the view class, shown in Listing
15.13. It draws the string when ShowString is running standalone and when the user
is editing in place, and it's the same as in the old version of ShowString. Just
copy it into the new one.</P>
<P>
<H4>Listing 15.13&#160;&#160;ShowStringView.cpp--CShowStringView::OnDraw()</H4>
<PRE>void CShowStringView::OnDraw(CDC* pDC)
{
     CShowStringDoc* pDoc = GetDocument();
     ASSERT_VALID(pDoc);
     COLORREF oldcolor;
     switch (pDoc-&gt;GetColor())
     {
     case 0:
          oldcolor = pDC-&gt;SetTextColor(RGB(0,0,0)); //black
          break;
     case 1:
          oldcolor = pDC-&gt;SetTextColor(RGB(0xFF,0,0)); //red
          break;
     case 2:
          oldcolor = pDC-&gt;SetTextColor(RGB(0,0xFF,0)); //green
          break;
     }
     int DTflags = 0;
     if (pDoc-&gt;GetHorizcenter())
     {
          DTflags |= DT_CENTER;
     }
     if (pDoc-&gt;GetVertcenter())
     {
          DTflags |= (DT_VCENTER|DT_SINGLELINE);
     }
     CRect rect;
     GetClientRect(&amp;rect);
     pDC-&gt;DrawText(pDoc-&gt;GetString(), &amp;rect, DTflags);
     pDC-&gt;SetTextColor(oldcolor);
</PRE>
<PRE>}
</PRE>
<P>When the embedded ShowString item is inactive, CShowStringSrvrItem::OnDraw() draws
it. The code in here should be very similar to the view's OnDraw, but because it
is a member of CShowStringSrvrItem rather than CShowStringView, it doesn't have access
to the same member variables. So although there is still a GetDocument() function
you can call, GetClientRect doesn't work. It's a member of the view class but not

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频在线免费看| 一区二区三区欧美视频| 欧美大胆一级视频| 欧美精品自拍偷拍| 欧美日韩一区久久| 欧美乱熟臀69xxxxxx| 制服丝袜日韩国产| 日韩欧美国产综合在线一区二区三区| 91精品国产综合久久婷婷香蕉 | 亚洲视频一区在线观看| 中文字幕亚洲电影| 亚洲人成亚洲人成在线观看图片 | 亚洲韩国一区二区三区| 亚洲午夜久久久| 亚洲电影第三页| 婷婷中文字幕一区三区| 蜜臀精品久久久久久蜜臀| 日韩成人伦理电影在线观看| 蜜臀av一区二区在线观看| 九色综合狠狠综合久久| 国产福利电影一区二区三区| 99久久精品国产毛片| 欧美伊人精品成人久久综合97| 欧美日韩免费电影| 欧美变态口味重另类| 久久蜜桃一区二区| 亚洲天堂免费看| 图片区小说区区亚洲影院| 精品一区二区在线看| 国产成人av一区二区三区在线 | 欧美一区二区三区四区在线观看 | 国产精品日韩精品欧美在线| 亚洲人快播电影网| 免费观看成人av| 国产成人久久精品77777最新版本| 成人国产精品免费观看视频| 欧美日韩国产a| 国产午夜精品在线观看| 中文字幕一区二区三区在线观看| 亚洲精品欧美激情| 蜜臀va亚洲va欧美va天堂| 成人av片在线观看| 在线播放国产精品二区一二区四区| 久久午夜国产精品| 亚洲狠狠丁香婷婷综合久久久| 老司机免费视频一区二区三区| 成人av资源网站| 91精品国产麻豆国产自产在线| 国产精品网曝门| 天天综合日日夜夜精品| 成人动漫一区二区| 91精品国产综合久久婷婷香蕉| 中文字幕在线观看不卡视频| 琪琪一区二区三区| 91污在线观看| 精品少妇一区二区三区在线播放 | 一区二区三区资源| 精品一区二区三区视频在线观看 | 国产情人综合久久777777| 亚洲综合色网站| 国产麻豆一精品一av一免费| 欧洲精品在线观看| 国产精品视频一二| 麻豆freexxxx性91精品| 91视视频在线观看入口直接观看www | 亚洲最新在线观看| 国产经典欧美精品| 欧美tickle裸体挠脚心vk| 一二三区精品视频| 成人午夜在线视频| 2020国产精品| 美女在线观看视频一区二区| 色综合天天做天天爱| 国产欧美综合色| 国内久久婷婷综合| 欧美一区二区网站| 亚洲第四色夜色| 色哟哟一区二区三区| 国产精品乱码人人做人人爱| 经典三级在线一区| 91精品国产综合久久福利| 亚洲激情中文1区| 99久久精品国产麻豆演员表| 国产亚洲欧美一区在线观看| 久久机这里只有精品| 3d动漫精品啪啪一区二区竹菊| 一级日本不卡的影视| eeuss影院一区二区三区| 久久久不卡影院| 狠狠色狠狠色合久久伊人| 精品欧美一区二区久久| 日韩中文字幕区一区有砖一区| 在线日韩国产精品| 亚洲精品欧美专区| 色噜噜偷拍精品综合在线| 亚洲图片激情小说| 99精品久久久久久| 综合网在线视频| 成人黄色片在线观看| 国产精品福利一区二区| va亚洲va日韩不卡在线观看| 国产精品视频看| 成人黄页在线观看| 日韩一区欧美一区| 91官网在线免费观看| 一级精品视频在线观看宜春院 | 亚洲国产高清不卡| 成人国产亚洲欧美成人综合网| 中文字幕亚洲精品在线观看| 99re成人精品视频| 曰韩精品一区二区| 欧美日韩精品系列| 蜜臀久久99精品久久久久宅男| 精品sm捆绑视频| 风间由美一区二区av101| 日韩一区有码在线| 欧美午夜一区二区三区| 日本三级亚洲精品| 久久精品综合网| 成人激情免费视频| 亚洲影院久久精品| 日韩视频免费观看高清完整版在线观看| 男人的天堂亚洲一区| 国产三级欧美三级日产三级99 | 国产日产精品一区| 一本大道av一区二区在线播放| 亚洲3atv精品一区二区三区| 日韩一区二区电影网| 国产mv日韩mv欧美| 亚洲永久免费av| 日韩欧美三级在线| av毛片久久久久**hd| 午夜成人免费视频| 久久综合中文字幕| 91麻豆精东视频| 麻豆精品国产91久久久久久| 日本一区二区在线不卡| 欧美性猛交一区二区三区精品| 激情图区综合网| 亚洲少妇屁股交4| 日韩区在线观看| 99久久国产综合精品女不卡| 视频一区欧美精品| 日本一区二区免费在线观看视频 | 亚洲精品一二三四区| 日韩一区二区三区观看| 丁香激情综合国产| 亚洲成在线观看| 久久香蕉国产线看观看99| 色猫猫国产区一区二在线视频| 久久精品国产**网站演员| 亚洲日本中文字幕区| 欧美一区在线视频| av在线一区二区三区| 日本一不卡视频| 日韩理论在线观看| 精品国产三级a在线观看| 一本色道久久加勒比精品| 久久99精品国产麻豆婷婷洗澡| 亚洲免费毛片网站| 久久久久久久久久久99999| 在线观看日韩电影| 成人综合婷婷国产精品久久 | 99久久精品免费看| 精品亚洲国产成人av制服丝袜| 伊人色综合久久天天人手人婷| 久久久影视传媒| 欧美一区二区成人6969| 色噜噜狠狠成人中文综合| 国产在线一区二区综合免费视频| 亚洲一线二线三线久久久| 国产精品视频在线看| 亚洲精品在线三区| 91精品国产91热久久久做人人 | 亚洲欧洲www| 国产欧美日韩视频在线观看| 日韩欧美高清在线| 欧美日本一区二区在线观看| 99在线精品免费| 成人亚洲一区二区一| 久久不见久久见免费视频7 | www.日韩在线| 国产一区二区0| 久久国产精品99久久久久久老狼| 亚洲国产精品自拍| 亚洲免费看黄网站| 亚洲婷婷综合色高清在线| 亚洲国产成人一区二区三区| 精品国产污网站| 日韩免费电影一区| 欧美一级日韩免费不卡| 欧美日韩电影在线| 在线欧美日韩精品| 91伊人久久大香线蕉| 91在线免费视频观看| 成人精品国产一区二区4080| 国产福利视频一区二区三区| 国产盗摄一区二区| 国产成a人亚洲精品| 国产激情视频一区二区在线观看|