⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 444.htm

📁 详细讲解动态链接库的文档,在VIsual c++开发环境下使用,适合新手学习
💻 HTM
📖 第 1 页 / 共 5 页
字号:
      <DIV class=MenuChapter><A 
      href="http://www.codeproject.com/script/Jobs/List.aspx">Job 
Board</A></DIV>
      <DIV class=MenuChapter><A 
      href="http://www.codeproject.com/Services/coffee.aspx">Code Project 
      Coffee</A></DIV>
      <DIV class=MenuChapter><A 
      href="http://www.codeproject.com/Services/TradePub.aspx">Free 
      Magazines</A></DIV><BR>
      <DIV class=MenuCat>Feature Zones</DIV>
      <DIV class=MenuChapter><A 
      href="http://www.codeproject.com/kb/Showcase/">Product Showcase</A></DIV>
      <DIV class=MenuChapter><A href="http://www.codeproject.com/Zones/IBM">IBM 
      DeveloperWorks</A></DIV>
      <DIV class=MenuChapter><A 
      href="http://www.codeproject.com/Zones/WhitePapers">WhitePapers / 
      Webcasts</A></DIV>
      <DIV class=MenuChapter><A 
      href="http://www.codeproject.com/Zones/Acresso">InstallShield 
      2009</A></DIV><BR>
      <DIV style="MARGIN-BOTTOM: 10px; TEXT-ALIGN: center">
      <SCRIPT type=text/javascript>document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d6247%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fadmentor%252fimages%252fcp_daily_150x80.gif%26C%3dFalse%26adid%3d6247%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22150%22%20height%3d%2280%22%3e%3c%2fa%3e"));</SCRIPT>
      </DIV>
      <SCRIPT type=text/javascript>document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d7324%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fAdm%252fimages%252facresso_IS09_Banner_160x600.gif%26C%3dFalse%26adid%3d7324%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22160%22%20height%3d%22600%22%3e%3c%2fa%3e"));</SCRIPT>
    </TD>
    <TD class=ArticlePane vAlign=top>
      <TABLE class=SearchHeaderBar cellSpacing=0 width="100%">
        <TBODY>
        <TR>
          <TD style="WIDTH: 60%; WHITE-SPACE: nowrap" vAlign=center 
            align=right><FORM style="MARGIN: 0px" name=Search 
            action=/info/search.aspx method=get><B>Search &nbsp;</B> <INPUT 
            class=SmallText style="WIDTH: 200px" name=artkw> <SELECT 
            class=SmallText style="FONT-WEIGHT: bold" name=sbo> <OPTION 
              value=kw selected>Articles</OPTION> <OPTION 
              value=fm>Messages</OPTION> <OPTION value=s>Jobs</OPTION></SELECT> <INPUT class=SmallText style="FONT-WEIGHT: bold" type=submit value=" Go! "> 
            &nbsp; </FORM></TD>
          <TD class=TinyText style="WHITE-SPACE: nowrap"><A 
            href="http://www.codeproject.com/info/search.aspx">Advanced 
            Search</A><BR><A 
            href="http://www.codeproject.com/script/Content/SiteMap.aspx">Sitemap</A> 
            | <A id=ctl00_SearchBarCtrl_AddToIESearchLnk 
            title="Add The Code Project to your IE search Providers" 
            onclick="window.external.AddSearchProvider('http://www.codeproject.com/info/OpenSearch.xml');return false;" 
            href="http://www.codeproject.com/">Add to IE Search</A> 
        </TD></TR></TBODY></TABLE><SPAN id=ctl00_ResultMessage></SPAN>
      <DIV id=ctl00_ArtDiv>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR vAlign=top>
          <TD vAlign=top width="100%">
            <TABLE>
              <TBODY></TBODY></TABLE>
            <DIV class=SmallText><IMG style="VERTICAL-ALIGN: middle" height=16 
            alt=print src="444.files/print.gif" width=16> <A 
            id=ctl00_ArticleHeaderLinks_PrintLnk 
            href="http://www.codeproject.com/KB/DLL/ResourceOnlyDLL.aspx?display=Print">Print</A> 
            &nbsp; <IMG style="VERTICAL-ALIGN: middle" height=16 
            alt="Broken Article?" src="444.files/report.gif" width=16> <A 
            id=ctl00_ArticleHeaderLinks_BrokenLnk 
            href="http://www.codeproject.com/script/Articles/Report.aspx?aid=9875">Report 
            Article</A> &nbsp; <IMG style="VERTICAL-ALIGN: middle" alt=Watch 
            src="444.files/watchon.png"> <A class="" id=bmw_9875,2 
            onclick="return watchMe(9875, 2);" 
            href="http://www.codeproject.com/script/Bookmarks/Add.aspx?obid=9875&amp;obtid=2&amp;bma=AddWatch" 
            name=ajaxBookmarkWatchLink>Watch</A> <SPAN class=TinyText 
            style="VISIBILITY: hidden"></SPAN><SPAN 
            id=ctl00_ArticleHeaderLinks_ArticleBmkWatch_Message></SPAN>&nbsp; 
            <IMG style="VERTICAL-ALIGN: middle" height=16 alt=Bookmark 
            src="444.files/link.png" width=16> <A class="" id=bm_9875,2 
            onclick="return bookmarkMe(9875, 2);" 
            href="http://www.codeproject.com/script/Bookmarks/Add.aspx?obid=9875&amp;obtid=2&amp;bma=AddBookmark" 
            name=ajaxBookmarkLink>Bookmark</A> <SPAN class=TinyText 
            style="VISIBILITY: hidden"></SPAN><SPAN 
            id=ctl00_ArticleHeaderLinks_ArticleBmk_Message></SPAN>&nbsp; <IMG 
            style="VERTICAL-ALIGN: middle" height=16 alt=Discuss 
            src="444.files/discuss.gif" width=15> <A 
            href="http://www.codeproject.com/KB/DLL/ResourceOnlyDLL.aspx#_comments">Discuss</A> 
            &nbsp; <IMG style="VERTICAL-ALIGN: middle" height=16 
            alt="Recommend Article" src="444.files/mail.gif" width=16>&nbsp;<A 
            id=ctl00_ArticleHeaderLinks_Recommend 
            href="http://www.codeproject.com/script/common/TellFriend.aspx?obtid=2&amp;obid=9875">Send&nbsp;to&nbsp;a&nbsp;friend</A> 
            </DIV></TD>
          <TD style="WIDTH: 100px; WHITE-SPACE: nowrap; TEXT-ALIGN: right">
            <TABLE id=CurRat>
              <TBODY>
              <TR>
                <TD>
                  <TABLE>
                    <TBODY>
                    <TR>
                      <TD class=SmallText id=ctl00_ArticleRating_VL 
                      style="WHITE-SPACE: nowrap" align=right><SPAN 
                        id=ctl00_ArticleRating_VoteLabel>70 votes for this 
                        Article.</SPAN></TD>
                      <TD>
                        <TABLE cellSpacing=0 cellPadding=0 border=1>
                          <TBODY>
                          <TR>
                            <TD width=20 bgColor=white height=7><IMG height=7 
                              src="444.files/red.gif" width=20 align=center 
                              border=0></TD>
                            <TD width=20 bgColor=white height=7><IMG height=7 
                              src="444.files/red.gif" width=20 align=center 
                              border=0></TD>
                            <TD width=20 bgColor=white height=7><IMG height=7 
                              src="444.files/red.gif" width=20 align=center 
                              border=0></TD>
                            <TD width=20 bgColor=white height=7><IMG height=7 
                              src="444.files/red.gif" width=20 align=center 
                              border=0></TD>
                            <TD noWrap width=20 bgColor=white height=7><IMG 
                              height=7 src="444.files/red.gif" width=9 
                              align=center border=0></TD></TR></TBODY></TABLE></TD></TR>
                    <TR id=ctl00_ArticleRating_PopularityRow>
                      <TD class=SmallText align=right colSpan=2><A 
                        id=ctl00_ArticleRating_PopularityLnk 
                        title="Calculated as rating x Log10(# votes)" 
                        href="http://www.codeproject.com/script/Articles/TopArticles.aspx?ta_so=1">Popularity: 
                        8.20</A> <SPAN 
                        id=ctl00_ArticleRating_PopularityLbl></SPAN><SPAN 
                        id=ratingVal>Rating: <B>4.44</B> out of 
                    5</SPAN></TD></TR></TBODY></TABLE></TD>
                <TD>
                  <DIV>
                  <TABLE class=HistTable 
                  title="Voting Distribution. Recent data only">
                    <TBODY>
                    <TR>
                      <TD><IMG title="4 votes, 5.7%" height=1 
                        alt="4 votes, 5.7%" src="444.files/pollcol.gif" width=10 
                        border=0><BR>1</TD>
                      <TD><IMG title="0 votes, 0.0%" height=1 
                        alt="0 votes, 0.0%" src="" width=10 border=0><BR>2</TD>
                      <TD><IMG title="1 vote, 1.4%" height=1 
                        alt="1 vote, 1.4%" src="444.files/pollcol.gif" width=10 
                        border=0><BR>3</TD>
                      <TD><IMG title="4 votes, 5.7%" height=1 
                        alt="4 votes, 5.7%" src="444.files/pollcol.gif" width=10 
                        border=0><BR>4</TD>
                      <TD><IMG title="61 votes, 87.1%" height=20 
                        alt="61 votes, 87.1%" src="444.files/pollcol.gif" 
                        width=10 
              border=0><BR>5</TD></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <DIV class="Callout SmallText" id=ctl00_confirmWarning 
      style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 20px; PADDING-TOP: 10px"><IMG 
      style="FLOAT: left; MARGIN-RIGHT: 10px" height=32 
      src="444.files/warning_32.png" width=32><B>Is your email address OK?</B> 
      You are signed up for our <A id=ctl00_SubscribeLink 
      href="http://www.codeproject.com/script/Membership/Subscribe.aspx?rp=%2fKB%2fDLL%2fResourceOnlyDLL.aspx">newsletters</A> 
      but your email address has not been reconfirmed in a long time. To make 
      this warning go away please click <A id=ctl00_RequestConfirmLink 
      href="http://www.codeproject.com/script/Membership/SendConfirmRequest.aspx?rp=%2fKB%2fDLL%2fResourceOnlyDLL.aspx">here</A> 
      to have a confirmation email sent so we can confirm your email address and 
      continue sending you your newsletters.</DIV><SPAN id=intelliTXT>
      <DIV id=contentdiv><!-- Main Page Contents Start --><!-- Article Starts -->
      <UL class=download>
        <LI><A 
        href="http://www.codeproject.com/KB/DLL/ResourceOnlyDLL/ResourceOnlyDLL_src.zip">Download 
        source files - 403 Kb</A> 
        <LI><A 
        href="http://www.codeproject.com/KB/DLL/ResourceOnlyDLL/ResourceOnlyDLL_demo.zip">Download 
        demo project - 389 Kb</A> </LI></UL>
      <P><IMG height=200 alt="Sample Image - pic.gif" src="444.files/pic.gif" 
      width=374></P>
      <H2>Introduction</H2>
      <P>As you know, creating multimedia applications with special effect like 
      sound, animation, web-link and so on is time-consuming. But there is a 
      method that is rapid and engaging.</P>
      <P>Method is : Using Resource-Only DLL.</P>
      <P>A resource-only DLL is a DLL that contains nothing but resources, such 
      as icons, bitmaps, strings, and dialog boxes.</P>
      <H2>What is necessary?</H2>
      <OL>
        <LI>An HTML file composed of image, sound, GIF animation, link,... 
        <LI>Bring the HTML file and all its needed files together in a folder. 
        </LI></OL>
      <P>Note: In your HTML file, create two buttons with links "exit" and 
      "execute" like below :</P><PRE lang=html><SPAN class=code-keyword>&lt;</SPAN><SPAN class=code-leadattribute>p</SPAN><SPAN class=code-keyword>&gt;</SPAN><SPAN class=code-keyword>&lt;</SPAN><SPAN class=code-leadattribute>a</SPAN> <SPAN class=code-attribute>hidefocuse</SPAN> <SPAN class=code-attribute>href</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>execute"</SPAN><SPAN class=code-keyword>&gt;</SPAN>
<SPAN class=code-keyword>&lt;</SPAN><SPAN class=code-leadattribute>img</SPAN> <SPAN class=code-attribute>border</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>0"</SPAN> <SPAN class=code-attribute>src</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>ExecNorm.gif"</SPAN> <SPAN class=code-attribute>ALT</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>This may execute somethings"</SPAN> 
<SPAN class=code-attribute>style</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>cursor: hand; position: absolute; z-index: 1; left: 45; top: 120"</SPAN>
<SPAN class=code-attribute>onmouseover</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>this.src='ExecHot.gif'"</SPAN> <SPAN class=code-attribute>onmouseout</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>this.src='ExecNorm.gif'"</SPAN> 
<SPAN class=code-attribute>width</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>75"</SPAN> <SPAN class=code-attribute>height</SPAN><SPAN class=code-keyword>="</SPAN><SPAN class=code-keyword>43"</SPAN> <SPAN class=code-keyword>&gt;</SPAN>
<SPAN class=code-keyword>&lt;</SPAN><SPAN class=code-keyword>/</SPAN><SPAN class=code-leadattribute>a</SPAN><SPAN class=code-keyword>&gt;</SPAN><SPAN class=code-keyword>&lt;</SPAN><SPAN class=code-keyword>/</SPAN><SPAN class=code-leadattribute>p</SPAN><SPAN class=code-keyword>&gt;</SPAN></PRE>
      <H2>How to create a Resource-Only DLL?</H2>
      <OL>
        <LI>Run VC++. 
        <LI>Click <B>New</B> on the <B>File</B> menu and then choose<B> MFC 
        AppWizard (dll)</B>; name it "<B>ResOnly</B>" 
        <LI>Click finish button in next step. 
        <LI>In ResourceView tab right-click on the root branch. 
        <LI>Choose the <B>Import...</B> command. 
        <LI>Import your HTML file; note only the HTML file. 
        <LI>Click <B>Save All</B> on the <B>File</B> menu and then close VC++. 
        <LI>Go to the folder that contains HTML file and all its needed files 
        and copy all files to VC++ project folder (ResOnly). 
        <LI>In <B>ResOnly</B> project folder find <I>.rc</I> file and open it 
        with notepad; point to HTML section. Now convert: <PRE lang=text>"IDR_HTML1     HTML     DISCARDABLE     "Skin.htm"
TO :
"Skin.htm         HTML     DISCARDABLE     "Skin.htm"</PRE>
        <P>Then add all needed files for imported HTML just below it:</P><PRE lang=text>/////////////////////
Skin.htm HTML DISCARDABLE "Skin.htm"
BG.gif HTML DISCARDABLE "BG.gif"
c.gif HTML DISCARDABLE "c.gif"
ExecHot.gif HTML DISCARDABLE "ExecHot.gif"
ExecNorm.gif HTML DISCARDABLE "ExecNorm.gif"
ExitHot.gif HTML DISCARDABLE "ExitHot.gif"
ExitNorm.gif HTML DISCARDABLE "ExitNorm.gif"
WMPAUD7.WAV HTML DISCARDABLE "WMPAUD7.WAV"
pupil.gif HTML DISCARDABLE "pupil.gif"
whites.gif HTML DISCARDABLE "whites.gif"
////////////////////</PRE>
        <LI>Save and close notepad and open VC++ Project (ResOnly). Press Build 
        button. Now you have a DLL containing resources; in fact, it is the 
        "Resource-Only DLL". </LI></OL>
      <H2>How to use created Resource-Only DLL in multimedia App?</H2>
      <OL>
        <LI>Run VC++. 
        <LI>Choose <B>New</B> on the <B>File</B> menu and then choose <B>MFC 
        AppWizard (exe).</B> 
        <LI>In <B>step1</B> dialogbox, select <B>Single document</B> and press 
        next button till <B>step6.</B> Now you choose <CODE>CHtmlView</CODE> as 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -