guple
所属分类:其他
开发工具:Visual C++
文件大小:48KB
下载次数:2
上传日期:2017-04-21 08:31:07
上 传 者:
eqmar
说明: 一个简单的com服务器和客户端程序,很好
(A simple com server and the client program, very good)
文件列表:
GreenMonkey.h (895, 2001-10-31)
MonkeyBoy.h (5893, 2001-10-31)
MonkeyClient\MonkeyBoy.h (5893, 2001-10-31)
MonkeySQDLG.h (1419, 2001-10-31)
resource.h (637, 2001-10-31)
StdAfx.h (929, 2001-10-31)
edlldata.c (813, 2001-10-31)
MonkeyBoy_i.c (1146, 2001-10-31)
MonkeyClient\MonkeyBoy_i.c (1146, 2001-10-31)
MonkeyBoy_p.c (8314, 2001-10-31)
HGreenMonkey.cpp (1080, 2001-10-31)
MonkeyBoy.cpp (1979, 2001-10-31)
MonkeyClient\MonkeyClient.cpp (2331, 2001-10-31)
MonkeySQDLG.cpp (198, 2001-10-31)
StdAfx.cpp (315, 2001-10-31)
smallmonkey.bmp (9566, 2001-10-31)
MonkeyBoy.aps (13716, 2001-10-31)
MonkeyBoy.clw (739, 2001-10-31)
MonkeyBoy.def (226, 2001-10-31)
MonkeyBoyps.def (251, 2001-10-31)
MonkeyBoy.dsp (13283, 2001-10-31)
MonkeyClient\MonkeyClient.dsp (4481, 2001-10-31)
MonkeyBoy.dsw (754, 2001-10-31)
MonkeyClient\MonkeyClient.dsw (547, 2001-10-31)
MonkeyBoy.idl (1017, 2001-10-31)
MonkeyBoyps.mk (478, 2001-10-31)
MonkeyBoy.ncb (99328, 2001-10-31)
MonkeyClient\MonkeyClient.ncb (41984, 2001-10-31)
MonkeyBoy.opt (62976, 2001-10-31)
MonkeyClient\MonkeyClient.opt (53760, 2001-10-31)
MonkeyBoy.plg (1616, 2001-10-31)
MonkeyClient\MonkeyClient.plg (258, 2001-10-31)
MonkeyBoy.rc (3843, 2001-10-31)
GreenMonkey.rgs (590, 2001-10-31)
MonkeyBoy.tlb (1952, 2001-10-31)
monkey.gif (13431, 2001-10-31)
MonkeyClient\Debug (0, 2001-10-31)
KDebug (0, 2001-10-31)
MonkeyBoy (0, 2017-03-22)
... ...
This is a very very simple COM Server and Client written with ATL.
To implement the included client/server, open MonkeyBoy folder and double click MonkeyBoy.dsw.
The workspace includes client and server. From the fileview tab, right click on MonkeyBoy files
select Set as active project, and compile. This will take care of the server.
Next, right click on MonkeyClient files, select Set as active project, and compile. This will take
care of the client.
Run the client from the command prompt to see it in action.
The following is how I built the server and client.
To build the COM server (monkeyboy.dll), start an ATL Project in Microsoft Visual Studio 6.0 by
selecting File/New from the menu. From the New dialog, select Projects. Select ATL COM Appwizard,
and on the right, enter the project name (this one is called monkeyboy or something like this...), and
below select the target directory for your project.
ATL AppWizard Step 1: Choose Dynamic Link Library as the server type. Ignore the rest and click
finish
After the New Project Information dialog appears, click OK. All you have now is a bare bones dll.
The next step is to add a simple COM object using the ATL Object Wizard. From the menu, select
Insert/New ATL Object. Select Simple Object from the dialog and click next. When the ATL Object
Wizard Properties dialog appears, enter in the C++ Short Name textbox an interface name (this server
uses GreenMonkey as the interface name). All other fields will be filled in. Next click on the
attribute tab. Set Threading model to single, Interface to custom, and Aggregation to No...ignore
the rest and click ok.
Click on the classview to see your interface (IGreenMonkey in this case). Add methods, properties etc.
by right clicking on the interface name. This project has three methods accessible through the
IGreenMonkey interface.
Check out the method implementations. Look at the simple win32 client. It was created using an
empty win32 console application. I just snaked two files from the server, MonkeyBoy.h, and
MonkeyBoy_i.c. These contain all interface information for the client to access the server.
The server includes a type library and files necessary for importation into any language that
supports COM.
ENJOY!
albert
近期下载者:
相关文件:
收藏者: