相关资料:

1.http://my.oschina.net/u/582827/blog/284766
2.http://www.cnblogs.com/findumars/p/5277561.html
3.http://www.360doc.com/content/12/1208/18/9200790_252887530.shtml
4.http://www.360doc.com/content/12/1208/18/9200790_252887530.shtml
5.http://blog.csdn.net/yoie01/article/details/12194367

结果:

1.Server端与Client端中的接口单元代码都是自动生成的,不用手动增加。
2.在Server中增加方法不能手动写(手写的保存时就不见了),必须用Delphi提供的编辑器(相关资料有提到)。

操作步伐:

Server端:
1.File->New->VCL Forms Application - Delphi for Win32->-Sava All。
2.File->New->Other...->Delphi Projects->ActiveX->Automation Object->CoClass Name->D2007Test->OK。
3.在Project1.tlb->选中“ID2007Test”->“New Method”->选中“Paramerers”->点“Add”->增加自己想要的方法。
4.保存Project1.tlb->Project1_TLB中就会有相关的接口方法了。
5.Unit2中编写对应方法的实现体(Variants必须引入)。
6.保存全部
7.生成EXE,在同目录中放一个“RegCom.cmd”文件,里面写上“D2007ComServer.exe -regserver”,双击此文件注册Server。

Client端:
1.File->New->VCL Forms Application - Delphi for Win32->-Sava All。
2.
D7->Project->Import Type Library...->选中“D2007ComServer”->Create Unit。
D2007->Component->Import Component...->选中“Import a Type Library”->Next->选中“D2007ComServer”->Next->Unit Dir Name->Next。
3.Unit1单元就可以编写调用代码了(D2007ComServer_TLB, ActiveX, OleServer必须引入)。

实例代码

Server端:

  1. unit Unit2;
  2.  
  3. {$WARN SYMBOL_PLATFORM OFF}
  4.  
  5. interface
  6.  
  7. uses
  8. ComObj, ActiveX, D2007ComServer_TLB, StdVcl,
  9. Variants;//Variants必须引入
  10. type
  11. TD2007TestD2007Test = class(TAutoObject, ID2007Test)
  12. private
  13. function TextToOleData(const AText: string): OleVariant;
  14. function OleDataToText(const AData: OleVariant): string;
  15. public
  16. //在此不得不说,COM中用的数据类型与咱们之前在DLEPHI的程序中有所不同。必须注意
  17. //A+B 加法
  18. procedure AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant); safecall;//整型数据处理
  19. //A&B 拼接
  20. procedure AddString(const AString1: WideString; const AString2: WideString;
  21. out AReturn: OleVariant); safecall;//字符串数据处理
  22. end;
  23.  
  24. implementation
  25.  
  26. uses ComServ;
  27.  
  28. { Td7test }
  29.  
  30. procedure TD2007TestD2007Test.AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant);
  31. begin
  32. AReturn := ANumber1 + ANumber2;
  33. end;
  34.  
  35. procedure TD2007TestD2007Test.AddString(const AString1: WideString; const AString2: WideString;
  36. out AReturn: OleVariant);
  37. begin
  38. AReturn := AString1 + ' ' + AString2;
  39. end;
  40.  
  41. function TD2007TestD2007Test.OleDataToText(const AData: OleVariant): string;
  42. var
  43. nSize: Integer;
  44. pData: Pointer;
  45. begin
  46. if AData = Null then
  47. Result := ''
  48. else begin
  49. nSize := VarArrayHighBound(AData, ) - VarArrayLowBound(AData, ) + ;
  50. SetLength(Result, nSize);
  51. pData := VarArrayLock(AData);
  52. try
  53. Move(pData^, Pchar(Result)^, nSize);
  54. finally
  55. VarArrayUnlock(AData);
  56. end;
  57. end;
  58. end;
  59.  
  60. function TD2007TestD2007Test.TextToOleData(const AText: string): OleVariant;
  61. var
  62. nSize: Integer;
  63. pData: Pointer;
  64. begin
  65. nSize := Length(AText);
  66. if nSize = then
  67. Result := Null
  68. else begin
  69. Result := VarArrayCreate([, nSize - ], varByte);
  70. pData := VarArrayLock(Result);
  71. try
  72. Move(Pchar(AText)^, pData^, nSize);
  73. finally
  74. VarArrayUnlock(Result);
  75. end;
  76. end;
  77. end;
  78.  
  79. initialization
  80. TAutoObjectFactory.Create(ComServer, TD2007TestD2007Test, Class_D2007Test,
  81. ciMultiInstance, tmApartment);
  82. end.

Server端接口:

  1. unit D2007ComServer_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING
  5. // -------
  6. // The types declared in this file were generated from data read from a
  7. // Type Library. If this type library is explicitly or indirectly (via
  8. // another type library referring to this type library) re-imported, or the
  9. // 'Refresh' command of the Type Library Editor activated while editing the
  10. // Type Library, the contents of this file will be regenerated and all
  11. // manual modifications will be lost.
  12. // ************************************************************************ //
  13.  
  14. // $Rev: 8291 $
  15. // File generated on 2016/8/15 14:49:21 from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: E:\D2007Com\D2007ComServer\D2007ComServer.tlb (1)
  19. // LIBID: {DF65EF04-7A4E-4A68-9132-7D357AF71708}
  20. // LCID: 0
  21. // Helpfile:
  22. // HelpString: D2007ComServer Library
  23. // DepndLst:
  24. // (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb)
  25. // ************************************************************************ //
  26. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
  27. {$WARN SYMBOL_PLATFORM OFF}
  28. {$WRITEABLECONST ON}
  29. {$VARPROPSETTER ON}
  30. interface
  31.  
  32. uses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;
  33.  
  34. // *********************************************************************//
  35. // GUIDS declared in the TypeLibrary. Following prefixes are used:
  36. // Type Libraries : LIBID_xxxx
  37. // CoClasses : CLASS_xxxx
  38. // DISPInterfaces : DIID_xxxx
  39. // Non-DISP interfaces: IID_xxxx
  40. // *********************************************************************//
  41. const
  42. // TypeLibrary Major and minor versions
  43. D2007ComServerMajorVersion = ;
  44. D2007ComServerMinorVersion = ;
  45.  
  46. LIBID_D2007ComServer: TGUID = '{DF65EF04-7A4E-4A68-9132-7D357AF71708}';
  47.  
  48. IID_ID2007Test: TGUID = '{BA65E10E-369E-4285-B7B7-4FE85678EAC0}';
  49. CLASS_D2007Test: TGUID = '{3C531DD1-361D-4F28-B817-3EA79DE2205A}';
  50. type
  51.  
  52. // *********************************************************************//
  53. // Forward declaration of types defined in TypeLibrary
  54. // *********************************************************************//
  55. ID2007Test = interface;
  56. ID2007TestDisp = dispinterface;
  57.  
  58. // *********************************************************************//
  59. // Declaration of CoClasses defined in Type Library
  60. // (NOTE: Here we map each CoClass to its Default Interface)
  61. // *********************************************************************//
  62. D2007Test = ID2007Test;
  63.  
  64. // *********************************************************************//
  65. // Interface: ID2007Test
  66. // Flags: (4416) Dual OleAutomation Dispatchable
  67. // GUID: {BA65E10E-369E-4285-B7B7-4FE85678EAC0}
  68. // *********************************************************************//
  69. ID2007Test = interface(IDispatch)
  70. ['{BA65E10E-369E-4285-B7B7-4FE85678EAC0}']
  71. procedure AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant); safecall;
  72. procedure AddString(const AString1: WideString; const AString2: WideString;
  73. out AReturn: OleVariant); safecall;
  74. end;
  75.  
  76. // *********************************************************************//
  77. // DispIntf: ID2007TestDisp
  78. // Flags: (4416) Dual OleAutomation Dispatchable
  79. // GUID: {BA65E10E-369E-4285-B7B7-4FE85678EAC0}
  80. // *********************************************************************//
  81. ID2007TestDisp = dispinterface
  82. ['{BA65E10E-369E-4285-B7B7-4FE85678EAC0}']
  83. procedure AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant); dispid ;
  84. procedure AddString(const AString1: WideString; const AString2: WideString;
  85. out AReturn: OleVariant); dispid ;
  86. end;
  87.  
  88. // *********************************************************************//
  89. // The Class CoD2007Test provides a Create and CreateRemote method to
  90. // create instances of the default interface ID2007Test exposed by
  91. // the CoClass D2007Test. The functions are intended to be used by
  92. // clients wishing to automate the CoClass objects exposed by the
  93. // server of this typelibrary.
  94. // *********************************************************************//
  95. CoD2007Test = class
  96. class function Create: ID2007Test;
  97. class function CreateRemote(const MachineName: string): ID2007Test;
  98. end;
  99.  
  100. implementation
  101.  
  102. uses ComObj;
  103.  
  104. class function CoD2007Test.Create: ID2007Test;
  105. begin
  106. Result := CreateComObject(CLASS_D2007Test) as ID2007Test;
  107. end;
  108.  
  109. class function CoD2007Test.CreateRemote(const MachineName: string): ID2007Test;
  110. begin
  111. Result := CreateRemoteComObject(MachineName, CLASS_D2007Test) as ID2007Test;
  112. end;
  113.  
  114. end.

Client端:

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs, StdCtrls,
  8. D2007ComServer_TLB, ActiveX, OleServer, jpeg, ExtCtrls;
  9.  
  10. type
  11. TForm1 = class(TForm)
  12. Button1: TButton;
  13. Label1: TLabel;
  14. Label2: TLabel;
  15. Image1: TImage;
  16. procedure Button1Click(Sender: TObject);
  17. private
  18. { Private declarations }
  19. public
  20. { Public declarations }
  21. end;
  22.  
  23. var
  24. Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.dfm}
  29.  
  30. procedure TForm1.Button1Click(Sender: TObject);
  31. var
  32. oD2007Test :TD2007Test;
  33. iInteger1, iInteger2: sysint;
  34. iResult: OleVariant;
  35. sString1, sString2: string;
  36. sResult: OleVariant;
  37. begin
  38. oD2007Test := TD2007Test.Create(nil);
  39. oD2007Test.ConnectKind := ckRunningOrNew;
  40. //数字处理
  41. iInteger1 := ;
  42. iInteger2 := ;
  43. iResult := ;
  44. oD2007Test.AddNumber(iInteger1, iInteger2, iResult);
  45. Label1.Caption := IntToStr(iResult);
  46. //字符处理
  47. sString1 := '';
  48. sString2 := '';
  49. sResult := '';
  50. oD2007Test.AddString(sString1, sString2, sResult);
  51. Label2.Caption := sResult;
  52. end;
  53.  
  54. end.

Clinet端接口:

  1. unit D2007ComServer_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING
  5. // -------
  6. // The types declared in this file were generated from data read from a
  7. // Type Library. If this type library is explicitly or indirectly (via
  8. // another type library referring to this type library) re-imported, or the
  9. // 'Refresh' command of the Type Library Editor activated while editing the
  10. // Type Library, the contents of this file will be regenerated and all
  11. // manual modifications will be lost.
  12. // ************************************************************************ //
  13.  
  14. // $Rev: 8291 $
  15. // File generated on 2016/8/15 14:29:34 from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: E:\D2007Com\D2007ComServer\D2007ComServer.exe (1)
  19. // LIBID: {DF65EF04-7A4E-4A68-9132-7D357AF71708}
  20. // LCID: 0
  21. // Helpfile:
  22. // HelpString: D2007ComServer Library
  23. // DepndLst:
  24. // (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb)
  25. // ************************************************************************ //
  26. // *************************************************************************//
  27. // NOTE:
  28. // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
  29. // which return objects that may need to be explicitly created via a function
  30. // call prior to any access via the property. These items have been disabled
  31. // in order to prevent accidental use from within the object inspector. You
  32. // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
  33. // removing them from the $IFDEF blocks. However, such items must still be
  34. // programmatically created via a method of the appropriate CoClass before
  35. // they can be used.
  36. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
  37. {$WARN SYMBOL_PLATFORM OFF}
  38. {$WRITEABLECONST ON}
  39. {$VARPROPSETTER ON}
  40. interface
  41.  
  42. uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants;
  43.  
  44. // *********************************************************************//
  45. // GUIDS declared in the TypeLibrary. Following prefixes are used:
  46. // Type Libraries : LIBID_xxxx
  47. // CoClasses : CLASS_xxxx
  48. // DISPInterfaces : DIID_xxxx
  49. // Non-DISP interfaces: IID_xxxx
  50. // *********************************************************************//
  51. const
  52. // TypeLibrary Major and minor versions
  53. D2007ComServerMajorVersion = ;
  54. D2007ComServerMinorVersion = ;
  55.  
  56. LIBID_D2007ComServer: TGUID = '{DF65EF04-7A4E-4A68-9132-7D357AF71708}';
  57.  
  58. IID_ID2007Test: TGUID = '{BA65E10E-369E-4285-B7B7-4FE85678EAC0}';
  59. CLASS_D2007Test: TGUID = '{3C531DD1-361D-4F28-B817-3EA79DE2205A}';
  60. type
  61.  
  62. // *********************************************************************//
  63. // Forward declaration of types defined in TypeLibrary
  64. // *********************************************************************//
  65. ID2007Test = interface;
  66. ID2007TestDisp = dispinterface;
  67.  
  68. // *********************************************************************//
  69. // Declaration of CoClasses defined in Type Library
  70. // (NOTE: Here we map each CoClass to its Default Interface)
  71. // *********************************************************************//
  72. D2007Test = ID2007Test;
  73.  
  74. // *********************************************************************//
  75. // Interface: ID2007Test
  76. // Flags: (4416) Dual OleAutomation Dispatchable
  77. // GUID: {BA65E10E-369E-4285-B7B7-4FE85678EAC0}
  78. // *********************************************************************//
  79. ID2007Test = interface(IDispatch)
  80. ['{BA65E10E-369E-4285-B7B7-4FE85678EAC0}']
  81. procedure AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant); safecall;
  82. procedure AddString(const AString1: WideString; const AString2: WideString;
  83. out AReturn: OleVariant); safecall;
  84. end;
  85.  
  86. // *********************************************************************//
  87. // DispIntf: ID2007TestDisp
  88. // Flags: (4416) Dual OleAutomation Dispatchable
  89. // GUID: {BA65E10E-369E-4285-B7B7-4FE85678EAC0}
  90. // *********************************************************************//
  91. ID2007TestDisp = dispinterface
  92. ['{BA65E10E-369E-4285-B7B7-4FE85678EAC0}']
  93. procedure AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant); dispid ;
  94. procedure AddString(const AString1: WideString; const AString2: WideString;
  95. out AReturn: OleVariant); dispid ;
  96. end;
  97.  
  98. // *********************************************************************//
  99. // The Class CoD2007Test provides a Create and CreateRemote method to
  100. // create instances of the default interface ID2007Test exposed by
  101. // the CoClass D2007Test. The functions are intended to be used by
  102. // clients wishing to automate the CoClass objects exposed by the
  103. // server of this typelibrary.
  104. // *********************************************************************//
  105. CoD2007Test = class
  106. class function Create: ID2007Test;
  107. class function CreateRemote(const MachineName: string): ID2007Test;
  108. end;
  109.  
  110. // *********************************************************************//
  111. // OLE Server Proxy class declaration
  112. // Server Object : TD2007Test
  113. // Help String : d7test Object
  114. // Default Interface: ID2007Test
  115. // Def. Intf. DISP? : No
  116. // Event Interface:
  117. // TypeFlags : (2) CanCreate
  118. // *********************************************************************//
  119. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  120. TD2007TestProperties= class;
  121. {$ENDIF}
  122. TD2007Test = class(TOleServer)
  123. private
  124. FIntf: ID2007Test;
  125. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  126. FProps: TD2007TestProperties;
  127. function GetServerProperties: TD2007TestProperties;
  128. {$ENDIF}
  129. function GetDefaultInterface: ID2007Test;
  130. protected
  131. procedure InitServerData; override;
  132. public
  133. constructor Create(AOwner: TComponent); override;
  134. destructor Destroy; override;
  135. procedure Connect; override;
  136. procedure ConnectTo(svrIntf: ID2007Test);
  137. procedure Disconnect; override;
  138. procedure AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant);
  139. procedure AddString(const AString1: WideString; const AString2: WideString;
  140. out AReturn: OleVariant);
  141. property DefaultInterface: ID2007Test read GetDefaultInterface;
  142. published
  143. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  144. property Server: TD2007TestProperties read GetServerProperties;
  145. {$ENDIF}
  146. end;
  147.  
  148. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  149. // *********************************************************************//
  150. // OLE Server Properties Proxy Class
  151. // Server Object : TD2007Test
  152. // (This object is used by the IDE's Property Inspector to allow editing
  153. // of the properties of this server)
  154. // *********************************************************************//
  155. TD2007TestProperties = class(TPersistent)
  156. private
  157. FServer: TD2007Test;
  158. function GetDefaultInterface: ID2007Test;
  159. constructor Create(AServer: TD2007Test);
  160. protected
  161. public
  162. property DefaultInterface: ID2007Test read GetDefaultInterface;
  163. published
  164. end;
  165. {$ENDIF}
  166.  
  167. procedure Register;
  168.  
  169. resourcestring
  170. dtlServerPage = '(none)';
  171.  
  172. dtlOcxPage = '(none)';
  173.  
  174. implementation
  175.  
  176. uses ComObj;
  177.  
  178. class function CoD2007Test.Create: ID2007Test;
  179. begin
  180. Result := CreateComObject(CLASS_D2007Test) as ID2007Test;
  181. end;
  182.  
  183. class function CoD2007Test.CreateRemote(const MachineName: string): ID2007Test;
  184. begin
  185. Result := CreateRemoteComObject(MachineName, CLASS_D2007Test) as ID2007Test;
  186. end;
  187.  
  188. procedure TD2007Test.InitServerData;
  189. const
  190. CServerData: TServerData = (
  191. ClassID: '{3C531DD1-361D-4F28-B817-3EA79DE2205A}';
  192. IntfIID: '{BA65E10E-369E-4285-B7B7-4FE85678EAC0}';
  193. EventIID: '';
  194. LicenseKey: nil;
  195. Version: );
  196. begin
  197. ServerData := @CServerData;
  198. end;
  199.  
  200. procedure TD2007Test.Connect;
  201. var
  202. punk: IUnknown;
  203. begin
  204. if FIntf = nil then
  205. begin
  206. punk := GetServer;
  207. Fintf:= punk as ID2007Test;
  208. end;
  209. end;
  210.  
  211. procedure TD2007Test.ConnectTo(svrIntf: ID2007Test);
  212. begin
  213. Disconnect;
  214. FIntf := svrIntf;
  215. end;
  216.  
  217. procedure TD2007Test.DisConnect;
  218. begin
  219. if Fintf <> nil then
  220. begin
  221. FIntf := nil;
  222. end;
  223. end;
  224.  
  225. function TD2007Test.GetDefaultInterface: ID2007Test;
  226. begin
  227. if FIntf = nil then
  228. Connect;
  229. Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
  230. Result := FIntf;
  231. end;
  232.  
  233. constructor TD2007Test.Create(AOwner: TComponent);
  234. begin
  235. inherited Create(AOwner);
  236. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  237. FProps := TD2007TestProperties.Create(Self);
  238. {$ENDIF}
  239. end;
  240.  
  241. destructor TD2007Test.Destroy;
  242. begin
  243. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  244. FProps.Free;
  245. {$ENDIF}
  246. inherited Destroy;
  247. end;
  248.  
  249. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  250. function TD2007Test.GetServerProperties: TD2007TestProperties;
  251. begin
  252. Result := FProps;
  253. end;
  254. {$ENDIF}
  255.  
  256. procedure TD2007Test.AddNumber(ANumber1: Integer; ANumber2: Integer; out AReturn: OleVariant);
  257. begin
  258. DefaultInterface.AddNumber(ANumber1, ANumber2, AReturn);
  259. end;
  260.  
  261. procedure TD2007Test.AddString(const AString1: WideString; const AString2: WideString;
  262. out AReturn: OleVariant);
  263. begin
  264. DefaultInterface.AddString(AString1, AString2, AReturn);
  265. end;
  266.  
  267. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  268. constructor TD2007TestProperties.Create(AServer: TD2007Test);
  269. begin
  270. inherited Create;
  271. FServer := AServer;
  272. end;
  273.  
  274. function TD2007TestProperties.GetDefaultInterface: ID2007Test;
  275. begin
  276. Result := FServer.DefaultInterface;
  277. end;
  278.  
  279. {$ENDIF}
  280.  
  281. procedure Register;
  282. begin
  283. RegisterComponents(dtlServerPage, [TD2007Test]);
  284. end;
  285.  
  286. end.

Com进程通信(Delphi2007)的更多相关文章

  1. Linux学习笔记(13)-进程通信|命名管道

    匿名管道只能在具有亲属关系的进程间通信,那么如果想要在不具有亲戚关系,想在陌生人之间通信,那又该怎么办呢? 别慌,Linux身为世界上*强大的操作系统,当然提供了这种机制,那便是命名管道-- 所谓命名 ...

  2. Android随笔之——跨进程通信(一) Activity篇

    在Android应用开发中,我们会碰到跨进程通信的情况,例如:你用QQ通讯录打电话的时候会调用系统的拨号应用.某些新闻客户端可以将新闻分享到QQ.微信等应用,这些都是跨进程通信的情况.简而言之,就是一 ...

  3. Android 进程通信机制之 AIDL

    什么是 AIDL AIDL 全称 Android Interface Definition Language,即 安卓接口描述语言.听起来很深奥,其实它的本质就是生成进程间通信接口的辅助工具.它的存在 ...

  4. Windows进程通信 -- 共享内存(1)

    共享内存的方式原理就是将一份物理内存映射到不同进程各自的虚拟地址空间上,这样每个进程都可以读取同一份数据,从而实现进程通信.因为是通过内存操作实现通信,因此是一种最高效的数据交换方法. 共享内存在 W ...

  5. MINIX3 进程通信分析

    MINIX3 进程通信分析 6.1MINIX3 进程通信概要 MINIX3 的进程通信是 MINIX3 内核部分最重要的一个部件,我个人认为其实这 是内核中的“内核”,怎么来理解这个概念呢?其实 MI ...

  6. Linux系统编程@进程通信(一)

    进程间通信概述 需要进程通信的原因: 数据传输 资源共享 通知事件 进程控制 Linux进程间通信(IPC)发展由来 Unix进程间通信 基于System V进程间通信(System V:UNIX系统 ...

  7. Linux下进程通信的八种方法

    Linux下进程通信的八种方法:管道(pipe),命名管道(FIFO),内存映射(mapped memeory),消息队列(message queue),共享内存(shared memory),信号量 ...

  8. WinForm实现跨进程通信的方法

    public class WinMessageHelper { private struct COPYDATASTRUCT { public IntPtr dwData; public int cbD ...

  9. 进程通信之一 使用WM_COPYDATA C++及C#实现(转)

    进程间通信最简单的方式就是发送WM_COPYDATA消息.本文提供C++及C#程序相互通信的二种实现方式.这样消息的接收端可以用C++实现,发送端可以用C++或C#实现.     发送WM_COPYD ...

随机推荐

  1. js实现ppt

    实现ppt的js框架有很多,这里推荐几个: impress.js      impress.js demo webSlide.js    webSlide.js demo reveal.js      ...

  2. devDependencies和dependencies的区别

    我们在使用npm install 安装模块或插件的时候,有两种命令把他们写入到 package.json 文件里面去,比如: --save-dev --save 在 package.json 文件里面 ...

  3. Codeforces 4538 (状态压缩dp)Little Pony and Harmony Chest

    Little Pony and Harmony Chest 经典状态压缩dp #include <cstdio> #include <cstring> #include < ...

  4. bzoj3955

    首先,最短路不同的两辆车一定不会发生堵塞 对于最短路相同的点,我们把属于最短路径上的边拎出来建图跑最大流即可 然后我TLE了…… 因为很明显建出来图很大,而真正流的流量很小 普通的初始标号都是0的sa ...

  5. BZOJ_1025_[SHOI2009]_游戏_(素数表+最小公倍数+DP)

    描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1025 分析 对于\(n\),转一圈回来之后其实是好几个环各转了整数圈.这些环中的数为\(1,2 ...

  6. js学习总结

    转自 http://blog.sina.com.cn/s/blog_75cf5f3201011csu.html 一: 关于基本数据类型在栈内存和堆内存中的关系 基本数据对于栈内存和堆内存是可以复制的, ...

  7. objective-c里的方法指针IMP的用法

    SGPopSelectView.h @interface SGPopSelectView : UIView @property (nonatomic, assign) SEL selector; @p ...

  8. Java [Leetcode 319]Bulb Switcher

    题目描述: There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off ...

  9. Java Socket(2): 异常处理

    1 超时 套接字底层是基于TCP的,所以socket的超时和TCP超时是相同的.下面先讨论套接字读写缓冲区,接着讨论连接建立超时.读写超时以及JAVA套接字编程的嵌套异常捕获和一个超时例子程序的抓包示 ...

  10. LeetCode: pow

    Title: https://leetcode.com/problems/powx-n/ 思路:二分.使用递归或者非递归.非递归有点难理解.pow(0,0)=1 递归的方法是将n为负数的用除法解决.有 ...