|
|
无法创建 ActiveX 组件
DLL源代码c#:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace ClassLibrary1
{
public interface qgIApplication
{
string GetText();
}
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public class qgApplication : qgIApplication
{
string qgIApplication.GetText()
{
Debug.WriteLine("GetText called.");
//你可以用各种方法取得数据
return ".NET class as coclass!";
}
}
}
调用DLL代码:
VB.NET
Dim temp As Object
temp = CreateObject("ClassLibrary1.qgIApplication")
MsgBox(temp.gettext())
不行!虽然已经注册成功,但在调用时错误:
无法创建 ActiveX 组件 ,
添加引用,已经注册的COM里找不到
[ 本帖最后由 raffles 于 2008-2-28 10:27 编辑 ] |
|