com事件入门

众所周知,delhpi对象有属性、方法和事件,但我们不能在TLB编辑器中
找到com事件,这里告诉您如何创建Com事件。
Writing COM Automation Events - by Borland Developer Support Staff
Abstract:A short tutorial on writing simple Automation server and client classes.
WHAT IS AN AUTOMATION EVENT?
The typical COM Client/Server model that you have probably worked with before allows the client to call the server through a supported interface. This is fine when a client calls the server to perform an action or retrieve data, but what about when the server wants to ask things of the client? Incoming interfaces are just that: incoming. There is no way for the server to talk to any of its clients. This is where the Server Events model comes into play. A Server that supports Events not only responds to calls from the client, but can also report status and make its own requests of the client. For Example: A client makes a request for the server to download a file. Instead of waiting for the server to finish this download before continuing (as with the previous model), the client can go about another task. When the server is done, it can fire an Event that lets the client know it is finished, thus allowing the client to respond accordingly.
HOW DO THEY DO IT?
The way in which a client is called by the server is not too much different in concept from the reverse. The server defines and fires events while the client is responsible for connecting to and implementing events. This is accomplished through an events interface or outgoing interface defined in the server object抯 type library. Now before we really get started, it抯 time for some terminology.
Connection Point: An entity describing the access to an events interface.
Event Source: An object that defines an outgoing interface and fires events, typically the Automation Server.
Event Sink: An object that implements an event interface and responds to events, typically the client.
Advise: Linking a sink to a connection point so that the sink抯 methods can be accessed by the source.
These are the main pieces of the Events model. If I were to sum this article up in one sentence it would be this: Simply put, an event sink will connect to a source via a connection point, thereby allowing the source to fire events implemented by the sink. My Goal now is to step through a simple server and client. The client will have a button that will call a server method. This method will simply fire and event that the client will catch and report via a memo control.
LET'S WRITE THE SERVER
Any Automation server that wants to communicate using events needs to define an outgoing interface, and must implement an incoming interface for finding and attaching to those interfaces. This incoming interface is IConnectionPointContainer. The client will use this interface to find or enumerate the connection points supported by the sink with the FindConnectionPoint and EnumConnectionPoints methods. An IConnectionPoint connection point will be returned, from which the client can then call Advise() to advise its sink to the connection point. Both of these interfaces are defined in ACTIVEX.PAS. You don抰 have to do it manually thankfully. The Automation Wizard will do all this for you.
So let抯 begin. Open a New Application and drop a TMemo on the form. Now go to New|Automation Object to start the Automation Wizard. Here you are asked for a coClass name. This example will use SimpleEventServer. Before clicking OK, check the box marked Generate Event Support Code. This is the implementation for your IConnectionPointContainer related things as described in the above paragraph (POOF!!! Delphi Magic!!!). The result will be a unit containing your TSimpleServer object and it抯 coClass definitions. Delphi will also generate a Type Library that includes the typical dual incoming interfaces ISimpleEventServer and ISimpleEventServerDisp, plus one you have not seen before, your outgoing events interface ISimpleEventServerEvents.
ISimpleEventServer now needs to expose a method for our client to call. Open the Type Library Editor (if it is not open already) and add a method CallServer(). Now we need to define an event for the server to fire, so we will and the method EventFired() to the ISimpleEventServerEvents. With this done, click on the Refresh Implementation button and then go back to the source unit for your server. You抣l notice that a method has been added. When the client calls the server, the server will inform the user via its memo, then fire the EventFired event. Implement it as follows:
procedure CallServer; safecall;
begin
  Form1.Memo1.Lines.Add('I have been called by a client');
  if FEvents <> nil then
  begin
    FEvents.EventFired;
    Form1.Memo1.Lines.Add('I am firing an Event');
  end;
end;
NOTE: FEvents is our outgoing interface. Notice that we check it before we fire the event off it. This ensures that a client is actually listening. If it has not been advised to a client sink, it will return NIL.
With that squared away, the Server is complete! Build and run it once to register it with the system.
THE CLIENT
Start a new application and add a TMemo and a button. Now go to the Unit source and add the TLB unit of your server to the USES clause so we can have access to those types and methods. Your main form object will need fields to hold the interfaces to the Server object and the event sink. Declare them in the private field as follows:
?
private
    { Private declarations }
    FServer: ISimpleEventServer;
    FEventSink: IUnknown;
    FConnectionToken: integer;
?/pre>
Once this groundwork is complete, we can start on the only difficult task in COM events:  The implementation of the Event Sink.   It starts by defining the Event Sink Object, which is an automation object, and therefore must implement IDispatch.  The job of the Event Sink is to delegate calls to itself by the server through it抯 Invoke() method.  It then calls the local implementation for the event.  To enforce a level of separation here, we will leave these implementations in the main unit and hold a reference to the main form in the sink object to call them off of.  Here is the Event Sink Definition:
TEventSink = class(TInterfacedObject, IUnknown,IDispatch)
  private
    FController: TForm2;
    {IUknown methods}
    function QueryInterface(const IID: TGUID; out      Obj):HResult;stdcall;
    {Idispatch}
    function GetTypeInfoCount(out Count: Integer): HResult; stdcall;
    function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
    function GetIDsOfNames(const IID: TGUID; Names: Pointer;
      NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
    function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
      Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
  public
    constructor Create(Controller: TForm2);
  end;
Most of these methods do not need to be implemented.  Making them simply return S_OK will do fine, for all except QueryInterface() and Invoke().  These methods are used by the server to obtain interfaces and call your event handlers.  
function TEventSink.QueryInterface(const IID: TGUID; out Obj):HResult;stdcall;
begin
  if GetInterFace(IID,Obj) then
    Result := S_OK
  else if IsEqualIID(IID,ISimpleEventServerEvents) then
    Result := QueryInterface(IDispatch,Obj)
  else
    Result := E_NOINTERFACE;
end;
This method first takes care its own IDispatch and IUnknown, then it recurses to get the outgoing interface if being queried for ISimpleEventServerEvents.
function TEventSink.Invoke(DispID: integer; const IID: TGUID; LocaleID: integer; Flags: Word; var Params; VarResult,ExcepInfo,ArgErr:Pointer): HResult;
begin
  Result := S_OK;
  case DispID of
    1: FController.OnEventFired;
  end;
end;
The case statement above would, of course, have more statements if we had more events, but this interface and sink only support one.  Note that Invoke() calls our handler through a local reference to the main form object where our event handler resides.  The Event Sink constructor should handle setting this up:
constructor TEventSink.Create(Controller: TForm2);
begin
  inherited Create;
  FController := Controller;
end;
With the methods and objects in place, all that is left is to connect sink to source!  We will do this in the Client抯 OnCreate event handler:
procedure TForm2.FormCreate(Sender: TObject);
begin
  FServer := CoSimpleEventServer.Create;
  FEventSink := TEventSink.Create(form2);
  InterfaceConnect(FServer, ISimpleEventServerEvents,FEventSink,FconnectionToken);
end;
NOTE:  Remember the FEventSink is an IUnknown, and we are receiving and interface from the TEventSink constructor, not a standard reference.  This will allow us to advise a connection point to it.
First, we create our server using its coClass.  Then we create an instance of our Event sink.  As I said earlier, the InterfaceConnect() method is easier to use, but you lose some functionality and understanding.  You can use it here by passing in your server抯 interface,  the IID of the events interface you are querying for, the IUnknown of your newly created event sink, and an integer representing the connection.  You MUST hold onto this integer if you wish to properly unadvise the connection.  You can disconnect by simply calling InterfaceDisconnect() using the token integer you received from your InterfaceConnect() call.  
Now compile and run the client.  The server should start and that抯 it!  You are now connected and listening for events! Click the client抯 button to test your event.
SOURCE UNITS EXAMPLES
Below are the units Server Object and Client Object units.  Ommited is the Main form of the server.  
**********************************
-------------------------------source-----------------------------
//SrvUnit2.pas
//Contains the Automation Server Object
unit SrvUnit2;
interface
uses
  ComObj, ActiveX, AxCtrls, Classes, SrvEvent_TLB, StdVcl, Srvunit1;
type
  TSimpleEventServer = class(TAutoObject, IConnectionPointContainer, ISimpleEventServer)
  private
    { Private declarations }
    FConnectionPoints: TConnectionPoints;
    FConnectionPoint: TConnectionPoint;
    FEvents: ISimpleEventServerEvents;
    { note: FEvents maintains a *single* event sink. For access to more
      than one event sink, use FConnectionPoint.SinkList, and iterate
      through the list of sinks. }
  public
    procedure Initialize; override;
  protected
    { Protected declarations }
    property ConnectionPoints: TConnectionPoints read FConnectionPoints
      implements IConnectionPointContainer;
    procedure EventSinkChanged(const EventSink: IUnknown); override;
    procedure CallServer; safecall;
  end;
implementation
uses ComServ;
procedure TSimpleEventServer.EventSinkChanged(const EventSink: IUnknown);
begin
  FEvents := EventSink as ISimpleEventServerEvents;
end;
procedure TSimpleEventServer.Initialize;
begin
  inherited Initialize;
  FConnectionPoints := TConnectionPoints.Create(Self);
  if AutoFactory.EventTypeInfo <> nil then
    FConnectionPoint := FConnectionPoints.CreateConnectionPoint(
      AutoFactory.EventIID, ckSingle, EventConnect)
  else FConnectionPoint := nil;
end;
procedure TSimpleEventServer.CallServer;
begin
  Form1.Memo1.Lines.Add('I have been called by a client');
  if FEvents <> nil then
  begin
    FEvents.EventFired;
    Form1.Memo1.Lines.Add('I am firing an Event');
  end;
end;
initialization
  TAutoObjectFactory.Create(ComServer, TSimpleEventServer, Class_SimpleEventServer,
    ciMultiInstance, tmApartment);
end.
//clientunit.pas
unit ClientUnit;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,SrvEvent_TLB,ActiveX, ComObj, StdCtrls;
type
  TForm2 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
    FServer: ISimpleEventServer;
    FEventSink: IUnknown;
    FConnectionToken: integer;
  public
    { Public declarations }
    procedure OnEventFired;
  end;
  TEventSink = class(TInterfacedObject, IUnknown,IDispatch)
  private
    FController: TForm2;
    {IUknown methods}
    function QueryInterface(const IID: TGUID; out Obj):HResult;stdcall;
    {Idispatch}
    function GetTypeInfoCount(out Count: Integer): HResult; stdcall;
    function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
    function GetIDsOfNames(const IID: TGUID; Names: Pointer;
      NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
    function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
      Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
  public
    constructor Create(Controller: TForm2);
  end;
var
  Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.OnEventFired;
begin
  Memo1.Lines.Add('I have recieved an event');
end;
constructor TEventSink.Create(Controller: TForm2);
begin
  inherited Create;
  FController := Controller;
end;
function TEventSink.Invoke(DispID: integer; const IID: TGUID; LocaleID: integer; Flags: Word; var Params; VarResult,ExcepInfo,ArgErr:Pointer): HResult;
begin
  Result := S_OK;
  case DispID of
    1: FController.OnEventFired;
  end;
end;
function TEventSink.QueryInterface(const IID: TGUID; out Obj):HResult;stdcall;
begin
  if GetInterFace(IID,Obj) then
    Result := S_OK
  else if IsEqualIID(IID,ISimpleEventServerEvents) then
    Result := QueryInterface(IDispatch,Obj)
  else
    Result := E_NOINTERFACE;
end;
function TEventSink.GetTypeInfoCount(out Count: Integer): HResult;
begin
  Result := S_OK;
end;
function TEventSink.GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult;
begin
  Result := S_OK;
end;
function TEventSink.GetIDsOfNames(const IID: TGUID; Names: Pointer;
      NameCount, LocaleID: Integer; DispIDs: Pointer): HResult;
begin
  Result := S_OK;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
  FServer := CoSimpleEventServer.Create;
  FEventSink := TEventSink.Create(form2);
  InterfaceConnect(FServer, ISimpleEventServerEvents,FEventSink,FConnectionToken);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
  Memo1.Lines.Add('I am calling the Server');
  FServer.CallServer;
end;
procedure TForm2.FormDestroy(Sender: TObject);
begin
  InterfaceDisconnect(FServer,ISimpleEventServer,FConnectionToken);
  FServer := nil;
  FEventSink := nil;
end;
end.


运行程序,click button1,客户memo1出现
I am calling the Server
I have recieved an event
如果没有出现I have recieved an event,检查server的接口单元(*_tlb.pas)
  ISimpleEventServerEvents = dispinterface
    ['{50402DF8-E13C-41D1-B607-8CC73A84162A}']
    procedure EventFired; dispid 1;
上述声明的dispid 必须与
clientunit.pas 中下列函数的DispID一致。
function TEventSink.Invoke(DispID: integer; const IID: TGUID; LocaleID: integer; Flags: Word; var Params; VarResult,ExcepInfo,ArgErr:Pointer): HResult;
begin
  Result := S_OK;
  case DispID of
    1: FController.OnEventFired;
  end;
end;
好好理解一下,然后再来一个在事件中传递参数的例子:
在server端打开tlb编辑器,
在ISimpleEventServer添加一个方法,名为CallByParam,无参数。
在SimpleEventServerEvents添加一个方法,名为PramEvent,,方法参数名为str,类型为bstr(const)
刷新tlb编辑器。
这时在_tlb.pas文件中可以看到以下声明
  ISimpleEventServerDisp = dispinterface
    ['{2914C9D6-D67B-43E7-A3B5-F666CF207EBE}']
    procedure CallServer; dispid 1;
    procedure CallByParam; dispid 2;
  end;
// *********************************************************************//
// DispIntf:  ISimpleEventServerEvents
// Flags:     (0)
// GUID:      {50402DF8-E13C-41D1-B607-8CC73A84162A}
// *********************************************************************//
  ISimpleEventServerEvents = dispinterface
    ['{50402DF8-E13C-41D1-B607-8CC73A84162A}']
    procedure EventFired; dispid 1;
    procedure ParamEvent(const str: WideString); dispid 2;
  end;
注意CallByParam的dispid ,等一下要用。
实现部分:
procedure TSimpleEventServer.CallByParam;
begin
  Form1.Memo1.Lines.Add('I have been called by another client');
  if FEvents <> nil then
  begin
    FEvents.ParamEvent('CallParam');
    Form1.Memo1.Lines.Add('参数事件');
  end;
end;
编译。
转到client,在TForm2的public段加以下声名:
procedure OnPramEvent(str:WideString);
实现部分:
procedure TForm2.OnPramEvent(str:WideString);
begin
  Memo1.Lines.Add('收到一个带参数事件'+str);
end;
TEventSink.Invoke现在变成这样:
function TEventSink.Invoke(DispID: integer; const IID: TGUID; LocaleID: integer; Flags: Word; var Params; VarResult,ExcepInfo,ArgErr:Pointer): HResult;
var V:Olevariant;
begin
  Result := S_OK;
  case DispID of
    1: FController.OnEventFired;
    2: begin
       V:=OleVariant(TDispParams(Params).rgvarg^[0]);
       FController.OnPramEvent(v);
    end;
  end;
end;
注意上面的DispID,在你的机子中是否为2。
较难理解的是 V:=OleVariant(TDispParams(Params).rgvarg^[0]);
Params是Invoke传递回来的无类型参数,通过TDispParams强制转换,现在
我们知道,如果有第二个参数的话,可以用rgvarg^[1]获得。
最后,在TForm2中加入一个按扭,事件为:
procedure TForm2.Button2Click(Sender: TObject);
begin
  Memo1.Lines.Add('I am calling the Server');
  FServer.CallByParam;
end;
运行client,效果如何?
浪费了我1小时,谢我啊?

来源:http://www.delphibbs.com/delphibbs/dispq.asp?lid=1479908

转载于:https://www.cnblogs.com/railgunman/archive/2010/11/25/1888257.html

在VC++程序中接收COM事件 在VC++程序中接收COM事件关键字:连接点 COM 事件 IDispEventImpl 接收事件是COM客户端中非常重要的功能。但是除了在MFC中能够接收控件[1]所发出的事件以外,VC++不能自动生成接收事件的代码。为了接收普通COM的事件,必须自行编写接收事件的代码。本文通过一个具体的实例说明如何在VC++程序中通过ATL编写接收COM事件的代码,当然,程序本身不必是ATL项目。 阅读详情

相关推荐

stm32F407 硬件COM事件触发六步换相

本文介绍了STM32定时器PWM通道配置的两种方式:传统顺序修改和COM事件同步修改。重点分析了COM事件机制,包括通过OCXM、CCXE、CCXNE位实现预装载配置,以及软件/硬件两种触发方式。详细说明了主从定时器的硬件触发配置过程,特别是TIM4作为霍尔传感器接口时的CCR2设置方法。同时指出了硬件触发在电机静止时可能导致的误触发问题,并建议通过软件判断来避免。最后对比了硬件COM和软件COM的优缺点,指出实际应用中更倾向于使用软件COM方式。

qq_44672392的博客 935

k8s常见异常事件及解决方案

当容器集群中的节点(宿主机)磁盘使用率达到85%之后,会触发自动的容器镜像回收策略,以便于释放足够的宿主机磁盘。比如容器的内存限制值配置了1Gi,而容器的内存随着容器内进程内存使用量的增加超过了1Gi,就会导致容器被操作系统Cgroup Kill。集群中的容器实例,DNS解析均依赖集群内的DNS组件,应用中业务请求的地址都需要经过集群DNS组件。重启集群中的coredns组件发生重启(重新创建),一般是由于coredns组件压力较大导致oom,请检查业务是否异常,是否存在应用容器无法解析域名的异常。

ss810540895的博客 3762

初识统一事件模型之COM连接点

学习C#的时候,最喜欢的就是event关键字,因为事件处理变得很轻松。以往在C++里,我们一般是使用回调函数或者虚函数(接口),虽然也挺方便,但是如果有多个事件接收者就比较麻烦了,而且每个人实现的回调方式都不一样。在COM编程模型里的连接点也很好,允许多个事件接收者,甚至利用COM的机制跨进程回调通知,可惜实现太负责,调用也麻烦。最好还是像C#的event关键字,清晰明了。在尝试使用Attribu

optman的专栏 2536

mysql docker oom_Docker OOM事件介绍

OOM(Out Of Memory)内存不足,通常是由于某些不稳定的进程占用过多的内存造成,在Docker中称为OOM事件,当容器使用的内存过多时就会发生OOM事件,这个事件是由Linux内核的内存管理机制发起,并将是使用占用内存过多的容器Kill掉,保证系统的可持续运行。Linux内核为了保证系统的稳定性而将内存划分为两大部分用户空间与内核空间用户空间是提供给用户进程所使用的内存空间。内核空间是...

weixin_39903375的博客 309

实时接收com组件抛出的事件

一、找到事件对用的DISPID 二、添加委托类 #pragma once #include "oaidl.h" #include #include "testEventCtrl.h" #define WM_NEWUSER 4 #define WM_CONNECT 6 class Skin : public IDispatch { public: Skin(v

angellove156的专栏 2307

【Com通信】Com模块的事件帧发送及周期报文的快慢发送机制

Com模块的事件帧发送及周期报文的快慢发送机制

qq_36056498的博客 2337

云主机OOM宕机原因分析及处理

jmap -dump:format=b,file=文件名 [pid],可以把指定java进程的堆内存快照搞到一个指定的文件里去,也可以用gcore工具来导出内存快照,然后用MAT工具/Eclipse MAT的内存分析插件,来对导出的文件进行分析去分析,确定导致OOM的对象;某次服务器告警宕机故障,无法ssh连入,控制台登录后查看,发生OOM事件,OOM就是我们常说的Out of Memory内存溢出,它是指需要的内存空间大于系统分配的内存空间,导致项目程序crash,甚至主机宕机;现场环境不涉及,可排除;

企业实战系列集 ●●● https://ximenjianxue.blog.youkuaiyun.com 2909

SolidWorks二次开发实战:COM对象模型、宏录制与批量参数化

SolidWorks二次开发的核心是理解其基于COM的自动化对象模型。作为进程外COM服务器,SolidWorks通过SldWorks.Application、ModelDoc2、Feature、Dimension等接口向外部程序暴露建模与文档操作能力。宏录制是新手切入API的最佳方式,从一段可回放的VBA代码出发,可以逐步构建批量属性写入、参数化改尺寸、自动导出等实用工具。Python与C#是两种典型选择:前者适合批量脚本,后者适合企业级Add-in插件。工程实践中,还需处理文档打开失败、尺寸名称漂移、批

weixin_28829479的博客 238

COM连接点事件event

COM 中的典型方案是让客户端对象实例化服务器对象,然后调用这些对象。然而,没有一种特殊机制的话,这些服务器对象将很难转向并回调到客户端对象。COM 连接点便提供了这种特殊机制,实现了服务器和客户端之间的双向通信。使用连接点,服务器能够在服务器上发生某些事件时调用客户端。 有了连接点,服务器可通过定义一个接口来指定它能够引发的事件。服务器上引发事件时,要采取操作的客户端会向服务器

丸子头的专栏 4632

C#的COM事件在C++和JAVA中触发和响应的实现

C#的COM事件在C++和JAVA中触发和响应的实现 C#中定义COM的事件,在C++或者JAVA中去实现事件,并由其执行相应的函数后触发COM内部的逻辑,然后响应事件。

告别外置电阻!揭秘MAX22201集成电流检测的5大设计优势(附PCB布局案例)

本文深入解析MAX22201集成电流检测技术在直流有刷电机驱动中的5大设计优势,包括BOM成本降低、PCB空间优化、动态性能提升等。通过与传统方案(如DRV8871+外置电阻)的实测对比,展示其在高精度电流检测、抗干扰能力和PCB布局简化方面的突破,并附有详细的PCB布局案例和配置指南。

weixin_29189377的博客 244

一些来自CodeGuru的COM入门教程

一些来自CodeGuru的COM入门教程

lesky的专栏 1492

ZYNQ新手必看:5分钟搞定SD卡与QSPI Flash双启动模式配置(附常见问题排查)

本文为ZYNQ开发者提供了SD卡与QSPI Flash双启动模式的完整配置指南与深度排错方法。详细解析了从BootROM、FSBL到BOOT.bin的启动链条,并分步讲解了在Vivado/Vitis中的硬件配置、软件工程创建及BOOT.bin文件生成流程。针对SD卡格式化、文件放置以及QSPI Flash烧录中的常见陷阱(如版本差异、时钟配置)给出了具体解决方案和排查清单,帮助开发者快速实现可靠的产品启动与程序固化。

ll5678的博客 935

python调用com以及com事件

python调用com以及com事件作者:梅劲松 Email:stephen.cn@gmail.com时间:2004年9月13日感谢:刘鑫python调用有事件发生的com时,需要一些技巧。 我们以ie这个com为例来讲解一下我的经验。 首先我们需要pywin32这个模块的支持,它提供了我们调用com便利直接方法。你可以www.sf.net搜索并下载它。 先运行如下

9420

Imputation Methods for scRNA Sequencing Data

越来越多的研究者使用单细胞RNA测序(scRNA-seq)技术来表征单细胞水平的转录图谱。他们用它来研究复杂组织的异质性、转录组动力学和未知生物的多样性。然而,在基因表达模式随机性的scRNA-seq数据中普遍存在许多技术和生物学上的噪音。这些数据通常具有高维、稀疏和大量“dropout”值的特点,并且受批处理效应的影响。scRNA-seq数据中大量的“dropout”值严重掩盖了基因之间的重要关系,阻碍了下游分析。因此,scRNA-seq数据dropout值的估算就显得尤为重要。

qq_34179307的博客 543

​​瑞芯微RK系列 vs 全志系列芯片:终极选型指南(2025版)​

​。

jinxi996611的博客 1万+

COM 中的事件处理

<br />在 COM 事件处理中,使用 event_source 和 event_receiver 属性分别建立事件源和事件接收器并指定 type=com。这些属性插入相应的自定义接口代码、调度接口代码和双重接口代码,使其应用到的类可以通过 COM 连接点激发事件并处理事件。声明事件<br />在事件源类中,在接口声明中使用 __event 关键字将该接口的方法声明为事件。当您将该接口的事件作为接口方法调用时将激发它们。事件接口上的方法可以具有零个或更多参数(这些参数均应为 in 参数)。返回类型可以是

WINCOL的专栏 1470

Fedora 41上安装钉钉7.6.25,我踩过的那些依赖坑和最终解决方案

本文详细记录了在Fedora 41上安装钉钉7.6.25版本的全过程,包括解决依赖问题、转换deb包为rpm格式、处理libm.so.6错误等关键步骤。通过分享这些实用技巧和最终解决方案,帮助Linux用户顺利在Fedora系统上运行钉钉客户端,提升工作效率。

weixin_30485379的博客 206

COM 连接点事件讲解

开发环境:VC++6.0测试环境:windows 2000 这篇文章是Alex C. Punnen.所写,在http://www.codeguru.com/上发表的,在此本人将其翻译成中文,和大家共享。 (注:本人翻译不当之处,还请各位多指正和谅解)运行环境:Windows 2000 Server, Microsoft Visual C++ 6此篇文章将用一个清晰的例子来描述COM中连

步入什么 3928

如何在 SAP BTP 上使用 Integration Suite 消费 S/4HANA Cloud API

SAP Integration Suite是一个集成平台即服务(iPaaS),允许开发人员顺利地将内部部署和基于云的应用程序和流程与SAP管理的工具和预构建内容进行集成。登录 SAP Business Technology Platform Cockpit,进入 integration suite:再点击 API management 进入 API Portal:或者直接从收藏夹里打开链接:https://304a49cetrial.integrationsuitetrial-apiportal.cfapp

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1699

RK3568_Android15适配以太网网卡gmac+国产phy芯片YT8531

本文介绍了在Android15 SDK上适配正点原子ATK-DLRK3568开发板网卡的过程。开发板采用GMAC接口搭配YT8531C PHY芯片,包含两个千兆网口。主要内容包括:硬件原理图确认、网络链路连接方式、内核DTS配置(包括GMAC0和GMAC1的参数设置)、PHY驱动适配(基于motorcomm.c驱动文件)、PHY寄存器读写调试方法以及MAC地址设置方式。文章还分析了常见问题,如网卡注册后无法ping通网络的故障现象。通过详细的硬件确认和软件配置,实现了双网卡在Android系统上的完整适配。

Android/Linux驱动开发传帮带学习,让驱动入门门槛更低! 2023

基于VB的COM编程入门教程

   

ark1111的专栏 3540

从业务角色到工作台:一步步创建 SAP Fiori Launchpad Space 与 Page

SAP S/4HANA Launchpad 配置优化指南:从业务角色出发构建高效工作台 本文针对S/4HANA项目中用户普遍反映的"入口难找"问题,提出基于Spaces和Pages的系统化解决方案。通过"以工作岗位为中心"的设计理念,将Launchpad信息架构重构为:一个业务角色对应一个Space,每个Space包含1-5个Page,Page内按任务划分2-5个Section,每个Section放置3-7个Tiles。文章详细阐述了从Business Role入手配

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 233

OLE技术专题——COM连接点事件(下)

Understanding COM Event HandlingBy Lim Bio Liong Change of Article TitlePlease note that I have changed the title of this article from "TEventHandler - A C++ COM Event Handler For IDispatch-Based Even

feijj2002_的专栏 3347

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

COM中事件驱动技术探讨

COM中事件驱动技术探讨           邹飞 版本v1.0 2004年7月 目  录 1.     问题的提出.... 3 2.     名次术语.... 3 3.     常用技术.... 3 3.1       紧密耦合事件(Tightly Coupled Events,TCE)... 3 3.1.1       连接点技术... 3 3.1.2       消息队列技术... 1

Zou Fei's BLOG 2112

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

上一篇: Using COM to Transfer Any Type of Data
下一篇: 解决接口不支持错误,给初学者一点帮助
aowo7144
博客等级 码龄10年 5粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值