Delphi客户端/ VS 2003 COM服务器 [英] Delphi client / VS 2003 COM Server
问题描述
我已经得到了一个用C#编写的COM服务器,我可以从VBScript调用
就好了,它完美无缺。但是,我将它导入Delphi 6或
Delphi 2005,我无法访问
服务器中的任何功能。有什么具体的东西我需要做才能获得
德尔福看到服务器的一部分功能?
谢谢,
glenn
I''ve gotten a COM server written in C# and I can call it from a VBScript
just fine and it works perfectly. However, I import it into Delphi 6 or
Delphi 2005 and I can not get access to any of the functions that are in the
server. Is there something specific that I need to do in order to get
Delphi to see the functions that are a part of the server?
Thanks,
glenn
推荐答案
" glenn" < GH ****** @ softeksoftware.com>在消息中写道
news:ub ************** @ TK2MSFTNGP10.phx.gbl ...
"glenn" <gh******@softeksoftware.com> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
我已经得到了用C#编写的COM服务器,我可以从VBScript中调用它
就好了,它运行得很好。但是,我将它导入Delphi 6或Delphi 2005,我无法访问
服务器中的任何功能。为了让Delphi看到作为服务器一部分的功能,我需要做些具体的工作吗?
谢谢,
glenn
I''ve gotten a COM server written in C# and I can call it from a VBScript
just fine and it works perfectly. However, I import it into Delphi 6 or
Delphi 2005 and I can not get access to any of the functions that are in
the
server. Is there something specific that I need to do in order to get
Delphi to see the functions that are a part of the server?
Thanks,
glenn
不知道问题是什么或者使用Delphi时应该做些什么,但是
我建议你去首先通过MSDN中的教程,
- COM Interop第1部分:C#客户端教程
- COM Interop第2部分:C#服务器教程
并导入Delphi中第2部分内置的服务器。
Willy。
Don''t know what the problem is or what should be done when using Delp but
I suggest you go through the tutorials in MSDN first,
- COM Interop Part 1: C# Client Tutorial
- COM Interop Part 2: C# Server Tutorial
and import the Server built in part 2 in Delphi.
Willy.
如何从Delphi调用COM服务器(我假设Delphi for Win32)?
在Delphi中,COM服务器是这样称呼:
使用ComObj;
Var
MyServer:Variant;
开始
MyServer:= CreateOleObject(''ServerName'');
MyServer.YourMethod(Param1,Param2);
结束;
电话你的服务器是这样的,并告诉我们这是否有效。我不太确定
(我在一年半之前停止编写Win32)但我认为
只能这样调用COM服务器(OLE Automation)就是这种方式)。我做了一个
OLE服务器,然后我从其他程序中调用了它的方法,但那个
是在Delphi 3之前的几年......
问候,
菲利普。
Hi,
How do you call the COM server from Delphi (I assume Delphi for Win32)?
In Delphi a COM server is called like this:
Uses ComObj;
Var
MyServer: Variant;
Begin
MyServer := CreateOleObject(''ServerName'');
MyServer.YourMethod(Param1, Param2);
End;
Call your server like this and tell us if this work. I am not so sure
(I stopped coding for Win32 before year and a half) but I think the
only way to call COM server (OLE Automation) is this way). I made one
OLE server and then I called its methods from other program, but that
was before years in Delphi 3...
Greetings,
Philip.
其实这是正确的,但你也可以当您将类型库导入到表单上时,删除创建
的组件,它会为您处理
create。我一直这样做,所以我知道这种方法就像
一样好。但问题是,当我创建组件然后
尝试访问其属性时,我无法看到属性并在编译时得到
错误。对于delphi和COM对象来说这是不正常的。
我现在正在尝试一下它会让你知道它是怎么回事......
我我试图手动指定功能对COm可见
看看它是否解决了我的问题...
回到一秒...... :-)
glenn
" Philip Hristov" < pH值******** @ gmail.com>在消息中写道
news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
Actually that is correct, however, you can also just drop the component that
is created when you import the type library onto a form and it handles the
create for you. I do this all the time so I know this method works just as
well. The problem however, is that when I create the component and then
attempt to access its properties, I can not see the properties and get
errors when I compile. This is not normal for delphi and COM objects.
I am trying a little test now and will let you know how it goes shortly...
I am attempting to manually specify that the functions be visible to COm to
see if it fixes my problem...
Be back in a second... :-)
glenn
"Philip Hristov" <ph********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
如何从Delphi调用COM服务器(我假设Delphi for Win32)?
在Delphi中,COM服务器的调用如下:
<使用ComObj;
Var
MyServer:Variant;
开始
MyServer:= CreateOleObject(''ServerName'');
MyServer。 YourMethod(Param1,Param2);
结束;
像这样打电话给你的服务器并告诉我们这是否有效。我不太确定
(我在一年半之前停止编写Win32)但我认为只有这样才能调用COM服务器(OLE Automation)。我制作了一个OLE服务器,然后我从其他程序中调用了它的方法,但那是在Delphi 3中的几年之前...
问候,
Hi,
How do you call the COM server from Delphi (I assume Delphi for Win32)?
In Delphi a COM server is called like this:
Uses ComObj;
Var
MyServer: Variant;
Begin
MyServer := CreateOleObject(''ServerName'');
MyServer.YourMethod(Param1, Param2);
End;
Call your server like this and tell us if this work. I am not so sure
(I stopped coding for Win32 before year and a half) but I think the
only way to call COM server (OLE Automation) is this way). I made one
OLE server and then I called its methods from other program, but that
was before years in Delphi 3...
Greetings,
Philip.
这篇关于Delphi客户端/ VS 2003 COM服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!