问题描述
嗨.
我一直在互联网上搜索C ++ COM服务器代码,但没有找到任何东西.有很多C#或VB代码,但没有C ++代码.
谁能帮我写一个简单的服务器?
我使用Visual Studio 2010创建了一个简单的EXE ATL项目,并向其中添加了SimpleObject作为ATL类.看来它可以正常运行,但是我无法使用VB访问创建的实例对象. (我的意思是晚绑定没有早)
例如我写道:
Hi.
I have been searching over the internet for a C++ COM server code, but I didn''t find any thing. There are lots of C# or VB codes but no C++ ones.
Can any body help me write a simple server?
I created a simple EXE ATL project with Visual Studio 2010 and added SimpleObject as ATL class to it. It appears that it runs correctly but I can not access to a created instance object with VB. (I mean late binding no early)
for example I wrote:
GetObject('',"TestServer.SimpleObject")
这是行不通的.但是:
it does not work. but :
set t = New TestServerLib.SimpleObject
有效.
我应该在ATL项目中做什么?为什么未注册SimpleObject接口?
这是我的示例项目文件:
http://www.mediafire.com/?365arde4jyd5v3x
任何工作文件或样本都可以帮助我.
谢谢.
works.
What should I do in ATL project? why SimpleObject interface is not registered?
here is my sample project file:
http://www.mediafire.com/?365arde4jyd5v3x
any working file or sample can help me.
Thanks.
推荐答案
这篇关于是否有Internet上没有使用MFC的C ++ EXE ATL ActiveX示例源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!