- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
.NET COM 互操作到目前为止一直运行良好。自从我升级到 Windows 7 后,我的 .NET COM 对象就无法再工作了。
我的 COM 对象很简单:
namespace Crap
{
[ComVisible(true)]
[Guid("2134685b-6e22-49ef-a046-74e187ed0d21")]
[ClassInterface(ClassInterfaceType.None)]
public class MyClass : IMyClass
{
public MyClass()
{}
public void Test()
{
MessageBox.Show("Finally got in here.");
}
}
}
namespace Crap
{
[Guid("1234685b-6e22-49ef-a046-74e187ed0d21")]
public interface IMyClass
{
}
}
assembly is marked ComVisible as well.
I register the assembly using
regasm /codebase /tlb "path"
dim objReg
Set objReg = CreateObject("Crap.MyClass")
MsgBox typename(objReg)
最佳答案
我不是 C# 人,但这里有一个我从 VB.net 转换而来的示例。请注意,我必须确保在项目级别有一个命名空间,然后在 VB 项目中有这个类。我知道这在 C# 项目中有所不同。
[ComClass(MyClass.ClassId, MyClass.InterfaceId, MyClass.EventsId)]
public class MyClass {
// These GUIDs provide the COM identity for this class
// and its COM interfaces. If you change them, existing
// clients will no longer be able to access the class.
public const string ClassId = "f58411e1-1689-4bf3-a0e1-b49f479e28ba";
public const string InterfaceId = "f4a575c6-62d2-44eb-af0f-f5b2bb65ad51";
public const string EventsId = "ad56e4f9-3512-4233-aae4-7d1c2457c08f";
// A creatable COM class must have a Public Sub New()
// with no parameters, otherwise, the class will not be
// registered in the COM registry and cannot be created
// via CreateObject.
public SalePayStatus() : base()
{
}
}
关于Windows 7 64Bit 上的 .NET COM Interop 让我头疼,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2749638/
前言 最近有个网友问了我一个问题:系统中大事务问题要如何处理? 正好前段时间我在公司处理过这个问题,我们当时由于项目初期时间比较紧张,为了快速完成业务功能,忽略了系统部分性能问题。项目顺利上线后,
我有以下目录结构: Main.py A/ __init__.py B/ __init__.py C/ __init__.py 文
这个头疼,所以有人可以给我留言吗? XML 就是这样(不是真正的东西,但为了清楚起见,这是一个示例):
本文全面探讨了卷积神经网络CNN,深入分析了背景和重要性、定义与层次介绍、训练与优化,详细分析了其卷积层、激活函数、池化层、归一化层,最后列出其训练与优化的多项关键技术:训练集准备与增强、损失
我的设置: Node.js 蒙古人 一个包含两个集合的简单数据库 - 库存和发票。 用户可以同时创建发票。 一张发票可能涉及多个库存项目。 我的问题: 保持库存完整性。想象一个场景,两个用户提交两张带
这一直是困扰我的问题,人品问题。我总是试图用小补丁来解决我的问题,实际上这从来没有解决我的问题。所以我正在寻找解决所有这些问题的非常强大的解决方案。我想了解大型应用程序(facebook,google
由于完全不受我控制的决定,我处于以下情况: 我在catalog.org 上有一个产品列表 单击产品上的“添加到购物车”按钮向 secure.com/product/add/[productKey] 发
我是一名优秀的程序员,十分优秀!