C# dll程序注册为com组件

sffofn 2011-07-22 06:29:50
怎么把C#编写的dll程序注册为com组件,供MFC调用啊,急!!!
...全文
407 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
zjq8888882009 2011-08-02
  • 打赏
  • 举报
回复
不懂 ~
jian03112 2011-08-02
  • 打赏
  • 举报
回复
mark
jian03112 2011-08-02
  • 打赏
  • 举报
回复
恩,以后用的上
ayun00 2011-08-02
  • 打赏
  • 举报
回复
mark
rwindwow 2011-07-30
  • 打赏
  • 举报
回复
关注下
WIKESOFT 2011-07-30
  • 打赏
  • 举报
回复
每天回帖即可获得10分可用分!
sdl2005lyx 2011-07-25
  • 打赏
  • 举报
回复
LZ,你现在的问题跟C#一点关系也没有,好好看看《COM本质论》,了解COM如何创建和使用。。。。
sffofn 2011-07-25
  • 打赏
  • 举报
回复
我在网上查的是 stdafx.h中 添加
#import "AchievementShow.tlb"
using namespace AchievementShow
但是我写的using 这一句总是出错:“AchievementShow”: 具有该名称的命名空间不存在

还有这一句 MyCom::MyCom_InterfacePtr p(__uuidof(MyCom::Class1)); 是什么意思?请详细讲解一下
validtimes 2011-07-25
  • 打赏
  • 举报
回复
还有这个,希望对你有帮助。

http://developer.51cto.com/art/200909/153811.htm
validtimes 2011-07-25
  • 打赏
  • 举报
回复
可以看这个链接:http://developer.51cto.com/art/200907/133668.htm
sdl2005lyx 2011-07-25
  • 打赏
  • 举报
回复
C++调用Com组件,这个你会吗?
sffofn 2011-07-25
  • 打赏
  • 举报
回复
注册成功后,C++程序怎么调用他呢
shaxiaoliang 2011-07-25
  • 打赏
  • 举报
回复
这个给力!!!
sdl2005lyx 2011-07-25
  • 打赏
  • 举报
回复
给你个我测试的例子:

[ComVisible(true)]
public interface IMath
{
[DispId(1)]
int Add(int a, int b);

[DispId(2)]
int Sub(int a, int b);
}

[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
public class Dotnet :ServicedComponent, IMath
{
#region IMath 成员

public int Add(int a, int b)
{
return a+b;
}

public int Sub(int a, int b)
{
return a - b;
}

#endregion
}
isjoe 2011-07-22
  • 打赏
  • 举报
回复

110,545

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧