﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-红马天下-最新评论</title><link>http://www.cnblogs.com/homer/commentsrss.aspx</link><description>红马天下</description><language>zh-cn</language><pubDate>Fri, 06 Mar 2009 09:36:55 GMT</pubDate><lastBuildDate>Fri, 06 Mar 2009 09:36:55 GMT</lastBuildDate><generator>cnblogs</generator><item><title>Re:用C#编写ActiveX控件（二）</title><link>http://www.cnblogs.com/homer/archive/2010/07/01/88780.html#1861692</link><dc:creator>bicabo</dc:creator><author>bicabo</author><pubDate>Thu, 01 Jul 2010 09:30:56 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2010/07/01/88780.html#1861692</guid><description><![CDATA[学完了楼主的第一篇,能运行出效果了.
现在来学第二篇了.希望能学会基本的应用!
嘿嘿.支持楼主,继续发精品!<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">bicabo</a> 2010-07-01 17:30 <a href="http://www.cnblogs.com/homer/archive/2010/07/01/88780.html#1861692#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:你真的懂CoCreateInstance吗？</title><link>http://www.cnblogs.com/homer/archive/2010/04/24/508823.html#1809541</link><dc:creator>e.辉</dc:creator><author>e.辉</author><pubDate>Sat, 24 Apr 2010 11:28:14 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2010/04/24/508823.html#1809541</guid><description><![CDATA[@草
你真是个垃圾,你MA怎么拉了你这么一泡屎.

文章写的很好!<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">e.辉</a> 2010-04-24 19:28 <a href="http://www.cnblogs.com/homer/archive/2010/04/24/508823.html#1809541#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#编写ActiveX控件（二）</title><link>http://www.cnblogs.com/homer/archive/2010/04/21/88780.html#1806384</link><dc:creator>暮日风远</dc:creator><author>暮日风远</author><pubDate>Wed, 21 Apr 2010 02:36:45 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2010/04/21/88780.html#1806384</guid><description><![CDATA[非常感谢homer，我的可以用，环境vs2008
完全代码
Demo.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace HelloWorld
{
    [Guid(&quot;CB5BDC81-93C1-11CF-8F20-00805F2CD064&quot;), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IObjectSafety
    {
        // methods 
        void GetInterfacceSafyOptions(
            System.Int32 riid,
            out System.Int32 pdwSupportedOptions,
            out System.Int32 pdwEnabledOptions);
        void SetInterfaceSafetyOptions(
            System.Int32 riid,
            System.Int32 dwOptionsSetMask,
            System.Int32 dwEnabledOptions);
    } 

    [Guid(&quot;58993762-9895-4c41-9815-5A440D7F31BC&quot;)]
    public partial class Demo : UserControl,IObjectSafety
    {
        public Demo()
        {
            InitializeComponent();
        }
        public void ShowMessage(string msg)
        {
            if (msg != null)
            {
                MessageBox.Show(msg);
            }
        } 
    
        #region IObjectSafety Members

        void IObjectSafety.GetInterfacceSafyOptions(int riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
        {
            pdwSupportedOptions = 1;
            pdwEnabledOptions = 2;
        }

        void IObjectSafety.SetInterfaceSafetyOptions(int riid, int dwOptionsSetMask, int dwEnabledOptions)
        {

        }

        #endregion
    }
}


AssemblyInfo.cs
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle(&quot;HelloWorld&quot;)]
[assembly: AssemblyDescription(&quot;&quot;)]
[assembly: AssemblyConfiguration(&quot;&quot;)]
[assembly: AssemblyCompany(&quot;FOUNDERTECH&quot;)]
[assembly: AssemblyProduct(&quot;HelloWorld&quot;)]
[assembly: AssemblyCopyright(&quot;Copyright &#169; FOUNDERTECH 2010&quot;)]
[assembly: AssemblyTrademark(&quot;&quot;)]
[assembly: AssemblyCulture(&quot;&quot;)]
[assembly: AllowPartiallyTrustedCallers()] 

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid(&quot;e6c239a2-f10d-4e68-91d0-bd2f93721495&quot;)]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [assembly: AssemblyVersion(&quot;1.0.*&quot;)]
[assembly: AssemblyVersion(&quot;1.0.0.0&quot;)]
[assembly: AssemblyFileVersion(&quot;1.0.0.0&quot;)]

helloworld.htm
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Untitled Page&lt;/title&gt;
    &lt;style type=&quot;text/css&quot;&gt;
        #Object1
        {
            height: 330px;
            width: 363px;
        }
        #helloworld
        {
            height: 334px;
            width: 476px;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body &gt; 
&lt;!--&lt;object id=&quot;helloworld&quot; classid=&quot;http://localhost/HelloWorld.dll#HelloWorld.Demo&quot;&gt; &lt;/object&gt;--&gt;
&lt;object id=&quot;helloworld&quot; classid=&quot;clsid:58993762-9895-4c41-9815-5A440D7F31BC&quot;&gt; &lt;/object&gt;
&lt;input type=&quot;button&quot; onclick=&quot;helloworld.ShowMessage('Hello World!')&quot; value=&quot;摁我&quot;
        style=&quot;height: 190px; width: 377px&quot; /&gt;&lt;br/&gt; 
&amp;nbsp;

&lt;/body&gt;
&lt;/html&gt;
<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">暮日风远</a> 2010-04-21 10:36 <a href="http://www.cnblogs.com/homer/archive/2010/04/21/88780.html#1806384#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#编写ActiveX控件（一）</title><link>http://www.cnblogs.com/homer/archive/2010/03/30/86473.html#1790236</link><dc:creator>Jeffrey.Liang</dc:creator><author>Jeffrey.Liang</author><pubDate>Tue, 30 Mar 2010 04:19:59 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2010/03/30/86473.html#1790236</guid><description><![CDATA[我做第一步时，在IE里看到的是这个效果：http://files.cnblogs.com/Jeffreyliang/Demo.zip(因博客园不允许直接上传图片，所以只好弄成zip的了)。

我的IIS主目录是wwwroot，我把弄好的DLL拷贝到C:\Inetpub\wwwroot\ActiveX目录里，然后建了一个叫ActiveX的虚拟目录指向它，访问的时候就出现了上面那种情况。
有谁知道是怎么回事吗？
项目急得很，又不得不弄个active x，急死人了<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">Jeffrey.Liang</a> 2010-03-30 12:19 <a href="http://www.cnblogs.com/homer/archive/2010/03/30/86473.html#1790236#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:关于《用C#编写ActiveX控件》的几点说明</title><link>http://www.cnblogs.com/homer/archive/2010/01/05/87423.html#1740910</link><dc:creator>eagle1020</dc:creator><author>eagle1020</author><pubDate>Tue, 05 Jan 2010 08:52:32 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2010/01/05/87423.html#1740910</guid><description><![CDATA[十分感谢！<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">eagle1020</a> 2010-01-05 16:52 <a href="http://www.cnblogs.com/homer/archive/2010/01/05/87423.html#1740910#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#编写ActiveX控件（一）</title><link>http://www.cnblogs.com/homer/archive/2009/12/30/86473.html#1737905</link><dc:creator>王洪剑</dc:creator><author>王洪剑</author><pubDate>Wed, 30 Dec 2009 12:55:34 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2009/12/30/86473.html#1737905</guid><description><![CDATA[太帅了，一定要留名。不要怪我灌水。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">王洪剑</a> 2009-12-30 20:55 <a href="http://www.cnblogs.com/homer/archive/2009/12/30/86473.html#1737905#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#编写ActiveX控件（一）</title><link>http://www.cnblogs.com/homer/archive/2009/12/17/86473.html#1726825</link><dc:creator>zxmzp2004</dc:creator><author>zxmzp2004</author><pubDate>Thu, 17 Dec 2009 08:11:20 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2009/12/17/86473.html#1726825</guid><description><![CDATA[我的邮箱是zxmzp2004@yahoo.com.cn.万分感谢。最好能发一份vs2008的代码给我
，慢慢研究学习<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">zxmzp2004</a> 2009-12-17 16:11 <a href="http://www.cnblogs.com/homer/archive/2009/12/17/86473.html#1726825#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#编写ActiveX控件（一）</title><link>http://www.cnblogs.com/homer/archive/2009/12/17/86473.html#1726823</link><dc:creator>zxmzp2004</dc:creator><author>zxmzp2004</author><pubDate>Thu, 17 Dec 2009 08:10:22 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2009/12/17/86473.html#1726823</guid><description><![CDATA[楼主好，我是新手。我用的环境是.net framework3.0，visual studio 2008,按照步骤来结果是一片空白，以为不知道啥原因，脑袋都搞得晕晕的。楼主能不能给我发一份源码，并告诉我“将此dll拷贝到IIS的虚拟根目录下，然后建立一个helloworld.htm的文件”应该如何拷贝啊，怎么咋都搞不出来啊，蒙了。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">zxmzp2004</a> 2009-12-17 16:10 <a href="http://www.cnblogs.com/homer/archive/2009/12/17/86473.html#1726823#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#编写ActiveX控件（一）</title><link>http://www.cnblogs.com/homer/archive/2009/11/18/86473.html#1700980</link><dc:creator>不进步，不爷们</dc:creator><author>不进步，不爷们</author><pubDate>Tue, 17 Nov 2009 23:51:14 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2009/11/18/86473.html#1700980</guid><description><![CDATA[  试了多次不成功的朋友们可以看看这里，我开始按照第一种方法做也是失败了N次，都是红X，十分郁闷，今天早上睡不着，起来捣鼓了一下，才发现可能在VS2008中安全控制比较强，只有生成Guid注册控件以后才会有博主所说的运行结果。大家可以直接试一下第二种。感谢博主，文章非常不错！<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">不进步，不爷们</a> 2009-11-18 07:51 <a href="http://www.cnblogs.com/homer/archive/2009/11/18/86473.html#1700980#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#编写ActiveX控件（一）</title><link>http://www.cnblogs.com/homer/archive/2009/11/10/86473.html#1694582</link><dc:creator>JohnSunny</dc:creator><author>JohnSunny</author><pubDate>Tue, 10 Nov 2009 13:37:17 GMT</pubDate><guid>http://www.cnblogs.com/homer/archive/2009/11/10/86473.html#1694582</guid><description><![CDATA[必须顶一下。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/homer/" target="_blank">JohnSunny</a> 2009-11-10 21:37 <a href="http://www.cnblogs.com/homer/archive/2009/11/10/86473.html#1694582#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>
