com_sample5

所属分类:ActiveX/DCOM/ATL
开发工具:Visual C++
文件大小:24KB
下载次数:15
上传日期:2006-04-09 10:28:31
上 传 者张启
说明:  < COM编程精彩实例>>一书的随书源代码光盘的代码,这是第五章的
(lt; Lt; COM programming wonderful example gt; Gt; A book with the CD-ROM source code, which is the fifth chapter)

文件列表:
C5\RESOURCE.H (730, 1999-12-09)
C5\SERVER.CPP (1644, 1999-12-09)
C5\SERVER.H (1860, 1999-12-09)
C5\StdAfx.cpp (208, 1999-11-14)
C5\StdAfx.h (1054, 1999-11-14)
C5\TestDlg.cpp (4610, 2000-02-21)
C5\TestDlg.h (1465, 2000-02-21)
C5\Tester.cpp (2110, 2000-02-21)
C5\Tester.dsp (4613, 2000-02-21)
C5\Tester.dsw (864, 1999-12-09)
C5\Tester.h (1324, 1999-11-14)
C5\Tester.rc (5878, 1999-12-13)
C5\Wizard (0, 2006-04-09)
C5\Server\RESOURCE.H (849, 1999-12-09)
C5\Server\Server.cpp (1913, 1999-12-09)
C5\Server\Server.def (220, 1999-12-09)
C5\Server\Server.dsp (8526, 2000-02-21)
C5\Server\Server.h (952, 1999-12-09)
C5\Server\Server.ico (1078, 1999-12-09)
C5\Server\Server.odl (2162, 1999-12-09)
C5\Server\Server.rc (4782, 2000-02-21)
C5\Server\SrvrCtl.bmp (238, 1999-12-09)
C5\Server\SrvrCtl.cpp (7064, 2000-02-21)
C5\Server\SrvrCtl.h (2320, 2000-02-21)
C5\Server\SrvrPpg.cpp (2345, 2000-02-21)
C5\Server\SrvrPpg.h (1328, 2000-02-21)
C5\Server\StdAfx.cpp (204, 1999-12-09)
C5\Server\StdAfx.h (1185, 1999-12-09)
C5\Server (0, 2006-04-09)
C5\RES\Tester.ico (1078, 1999-11-14)
C5\RES\Tester.rc2 (398, 1999-11-14)
C5\RES (0, 2006-04-09)
C5 (0, 2006-04-09)

///////////////////////////////////////////////////////////////////// // How to use the ActiveX Control. ///////////////////////////////////////////////////////////////////// 1) The client should call the following to initialize the COM DLL from the main process _and_ from any thread that will be using COM: ::CoInitializeEx( NULL, //always NULL COINIT_APARTMENTTHREADED //see book about threading models ); NOTE: You also need to add _WIN32_DCOM to your project settings under "Preprocessor definitions" in order to get the prototype definition for ::CoInitializeEx() included in your compile. 2) In the Dialog Editor, right click on the dialog template and pick the "Insert ActiveX Control" menu item. Then pick the ActiveX control from the list of registered controls. 3) To handle events generated by the control in this template's dialog class, start by right clicking on the control in the dialog editor. 4) Select the control's ID from the "Class or object to handle" listbox. 5) Doubleclick the event you want to handle from the "New windows/message events" listbox and edit the handler. 6) To access the control's methods and properties, start by opening the ClassWizard and select this template's dialog class. 7) Click on the Member Variables tab and select the control in the list box and click on "Add Variable". The ClassWizard will now automatically wrap this control in a class and add it to your project. 8) Use this member variable class like any MFC control class. ///////////////////////////////////////////////////////////////////// // From: COM Programming by Example by John E. Swanke // Copyright (C) 2000 jeswanke. All rights reserved. /////////////////////////////////////////////////////////////////////

近期下载者

相关文件


收藏者