CN105893092A - COM component processing method and device - Google Patents

COM component processing method and device Download PDF

Info

Publication number
CN105893092A
CN105893092A CN201610201537.3A CN201610201537A CN105893092A CN 105893092 A CN105893092 A CN 105893092A CN 201610201537 A CN201610201537 A CN 201610201537A CN 105893092 A CN105893092 A CN 105893092A
Authority
CN
China
Prior art keywords
com
agent components
component
registered
com component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610201537.3A
Other languages
Chinese (zh)
Other versions
CN105893092B (en
Inventor
尚子峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yayue Technology Co ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610201537.3A priority Critical patent/CN105893092B/en
Publication of CN105893092A publication Critical patent/CN105893092A/en
Application granted granted Critical
Publication of CN105893092B publication Critical patent/CN105893092B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

The invention discloses a COM component processing method. The method includes the steps that before a COM component beyond a process is loaded in the process of an application program, a COM agent component of the COM component is acquired; the COM agent component is loaded in the current process; the COM agent component is registered into the process. According to the technical scheme, the COM component registration reliability can be improved.

Description

Com component treating method and apparatus
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of com component treating method and apparatus.
Background technology
COM (The Component Object Model, Component Object Model) assembly is that Microsoft is in order to make meter A kind of new software development skill that the production of software of calculation machine industry more conforms to the way of act of the mankind and develops Art.Under COM framework, people can develop the assembly that various function is single-minded, then by them Combine as required, constitute complicated application system.
Summary of the invention
The embodiment of the present invention provides a kind of com component treating method and apparatus, to improve com component registration Reliability.
The embodiment of the present invention provides a kind of com component processing method, and the process at an application program loads described Before described com component outside process, this includes:
Obtain the COM Agent components of described com component;
Described COM Agent components is loaded in described current process;
Described COM Agent components is registered in described process.
The embodiment of the present invention provides a kind of com component processing means, is applied to load in the process of an application The client of the described com component outside described process, this device includes:
Acquisition module, for obtaining the COM Agent components of described com component;
Load-on module, for loading described COM Agent components in described current process;
Registering modules, for being registered to described COM Agent components in described process.
In embodiments of the present invention, before the com component outside this process loading process, this COM is obtained The COM Agent components of assembly.This COM Agent components is loaded in current process, and by this COM generation Reason component register is in this process.By this processing procedure, it is possible to achieve this com component is in this process Registration.Without being registered in the registration table of system by this com component, the damage because of registration table therefore can be avoided The registration failure badly caused, improves the reliability of registration.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that below, Accompanying drawing in description is only some embodiments of the present invention, for those of ordinary skill in the art, On the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
The schematic flow sheet of a kind of com component processing method that Fig. 1 provides for the embodiment of the present invention;
A kind of com component process flow schematic diagram that Fig. 2 provides for the embodiment of the present invention;
A kind of com component process flow schematic diagram that Fig. 3 provides for the embodiment of the present invention;
The structural representation of a kind of com component processing means that Fig. 4 provides for the embodiment of the present invention;
The structural representation of a kind of com component processing means that Fig. 5 provides for the embodiment of the present invention.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly Chu, it is fully described by, it is clear that described embodiment is only a part of embodiment of the present invention rather than complete The embodiment in portion.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creativeness The every other embodiment obtained under work premise, broadly falls into the scope of protection of the invention.
In an embodiment of the present invention, before the com component outside process loads this process, needing should Com component is registered to operating system.Operating system records the address of this com component in registration table.When When process loads this com component, this process searches this registration table, finds this com component, by this COM Assembly is loaded into current process.
Content in above-mentioned registration table is likely destroyed, in the registration table that preserves because of system Holding registration failure that is destroyed and that cause, the embodiment of the present invention provides following solution.
The schematic flow sheet of a kind of com component processing method that Fig. 1 provides for the embodiment of the present invention.Such as Fig. 1 Shown in, in embodiments of the present invention, the process at an application program load the com component outside this process it Before, the method comprises the steps:
Step 101, obtains the COM Agent components of described com component.
Step 102, loads described COM Agent components in described current process.
Step 103, is registered to described COM Agent components in described process.
In embodiments of the present invention, before the com component outside this process loading process, this COM is obtained The COM Agent components of assembly.This COM Agent components is loaded in current process, and by this COM generation Reason component register is in this process.By this processing procedure, it is possible to achieve this com component is in this process Registration.Without being registered in the registration table of system by this com component, the damage because of registration table therefore can be avoided The registration failure badly caused, improves the reliability of registration.Further, it is also possible to alleviate the burden of system.
A kind of com component process flow schematic diagram that Fig. 2 provides for the embodiment of the present invention.Such as Fig. 2 institute Showing, before the process of an application program loads the com component outside this process, the method includes walking as follows Suddenly.
The embodiment of the present invention can apply to be there is a need to call in process the com component outside this process Application program.In embodiments of the present invention, can be when this process initiation, it is also possible to be that this process prepares When loading this com component, obtain the COM Agent components of this com component and this COM is acted on behalf of group Part registration is when this process.
Step 201, obtains the COM Agent components of described com component.
Process is the basis of operating system configuration;It it is the execution of a secondary program;It is a program and data exist The activity that on datatron, order is occurred when performing;It it is the process run on a data acquisition system of program;It It it is a system individual carrying out Resource Distribution and Schedule.Process in embodiments of the present invention refers to Arbitrarily need to call the process of the com component outside this process.
In embodiments of the present invention, this application program can be any application, such as browser, social activity Software etc..This com component is that the assembly of the specific function developed under COM framework, such as video are inserted Part.
In the present embodiment, when an application program, such as browser are opened, and the process of this browser is held The Agent components of this com component is obtained during row.Can also be, in program operation process, when needs call During this com component, obtain the Agent components of this com component, and register.
In an embodiment of the present invention, the Agent components of this com component is also a kind of com component.Should Com component and this COM Agent components are one to one, can be in advance by the COM of this com component Agent components is saved under the file directory installing file place of current process.Group is acted on behalf of obtaining this COM During part, the file directory at this installation file place can be arrived and go down lookup.
Step 202, loads this COM Agent components in current process.
Step 203, is registered to this COM Agent components in this process.
In embodiments of the present invention, connect by obtaining the interface of this COM Agent components unknown (IUnknown) Mouthful, and described IUnknown interface is registered to described process, and obtain described COM Agent components Class mark (CLSID) and interface identifier (IID), and described CLSID and IID is registered to described process.
Step 204, utilizes this COM Agent components to call the COM process that this com component is corresponding.
In this step, the method calling COM process corresponding to this com component includes:
Trigger described COM Agent components and parameter is carried out row collection process;Instructing described COM Agent components will The described parameter that row collection processes is sent to the COM process that described com component is corresponding, so that described COM The function that process utilizes COM process described in the parameter call that described row collection processes corresponding generates and performs result;Connect Receive described COM process and return described execution result.In embodiments of the present invention, the parameter that this row collection processes can Think the input variable of function corresponding to this COM process.
Utilizing the embodiment of the present invention, when process needs to load the com component outside this process, this process first will The COM Agent components of this com component is registered to this process.This COM Agent components is being registered to this After process, it is possible to use this COM Agent components calls the COM process that this com component is corresponding.
A kind of com component process flow schematic diagram that Fig. 3 provides for the embodiment of the present invention.Such as Fig. 3 institute Showing, before the process of an application program loads the com component outside this process, the method includes walking as follows Suddenly.
Step 301, loads COM Agent components.
In the present embodiment, needing the com component called is the assembly outside this process.Assume to need registration The interface of com component is IID_Idictionary.The COM Agent components assuming this com component is ProComPS.dll.This process can be called LoadLibrary and load this ProComPS.dll.
Step 302, obtains proxy function address.
In embodiments of the present invention, the proxy function address that ProComPS.dll derives is obtained, i.e. DllGetClassObject。
Step 302, obtains IUknown interface.
This IUknown interface is called this DllGetClassObject as CLSID and obtains this IUknown Interface.
Step 304, it may be judged whether successfully get this IUknown interface.If successfully obtaining this IUknown Interface, then perform step 305;Otherwise perform step 309, terminate this flow process.
Step 305, is registered to current process by this IUknown interface.
Utilize CoRegisterClassObject that this IUknown interface got is registered to current process.
Step 306, it may be judged whether successfully IUknown interface is registered to current process.If successfully should IUknown interface is registered to current process and performs step 307;Otherwise perform step 309, process ends.
Step 307, is registered to current process by CLSID and IID of this COM Agent components.
In this step, this CLSID and IID is IID_IDictionary.Utilize CoRegisterPSClsid This CLSID and IID is registered to current process.
Step 308, utilizes this COM Agent components to call the COM process that this com component is corresponding.
In embodiments of the present invention, the COM process calling this com component corresponding includes: trigger described COM Agent components carries out row collection process to parameter;Instruct the institute that row collection is processed by described COM Agent components State parameter and be sent to the COM process that described com component is corresponding, so that described COM process utilizes described The function generation execution result that COM process described in the parameter call that row collection processes is corresponding;Receive described COM Process returns described execution result.
This process utilizes CoCreateInstance to obtain the interface of this COM Agent components, i.e. IID_Idictionary.Call the function in IDictionary to trigger this COM Agent components, parameter to be carried out Row collection processes, and instructs this COM Agent components the parameter processed through row collection is sent to this com component pair Answer COM process.It is corresponding that this COM process utilizes this to perform this COM process through the parameter that row collection processes Function, generates and performs result and return.
Step 309, process ends.
By this process that is registered to of the com component outside this process, and can be completed this by above-described embodiment Calling of com component, can improve the reliability of registration, alleviates the burden of system.
The structural representation of a kind of com component processing means that Fig. 4 provides for the embodiment of the present invention.This device Can apply to load the client of the com component outside this process in the process of an application.This device bag Include: acquisition module 401, load-on module 402 and Registering modules 403.
This acquisition module 401, for obtaining the COM Agent components of described com component.
This load-on module 402, for loading described COM Agent components in described current process.
This Registering modules 403, for being registered to described COM Agent components in described process.
In an embodiment of the present invention, this acquisition module 401, it is further used for the installation in described current process Search and described com component the most described COM Agent components under the file directory at file place.
In an embodiment of the present invention, this Registering modules 403 includes: the first registration submodule 4031 and second Registration submodule 4032.This first registration submodule 4031, for obtaining described COM Agent components IUnknown interface, and described IUnknown interface is registered to described process.This second registration submodule 4032, for obtaining CLSID and IID of described COM Agent components, and by described CLSID and IID It is registered to described process.
In an embodiment of the present invention, this device farther includes: calling module 404.This calling module 404, For utilizing this COM Agent components to call the COM process that described com component is corresponding.
In an embodiment of the present invention, this calling module 404 includes: triggers module 4041, instruction submodule Block 4042 and reception submodule 4043.This triggers module 4041, is used for triggering described COM Agent components Parameter is carried out row collection process.Instruction submodule 4042, is used for instructing described COM Agent components and is collected by row The described parameter processed is sent to the COM process that described com component is corresponding, so that described COM process The function utilizing COM process described in the parameter call that described row collection processes corresponding generates and performs result.Receive son Module 4043, is used for receiving described COM process and returns described execution result.
The structural representation of a kind of com component processing means that Fig. 5 provides for the embodiment of the present invention.Fig. 5 institute The device shown can apply to load the client of the com component outside this process in the process of an application. This device includes: processor 501, non-volatile computer readable memory 502, display unit 503, net Network communication interface 504.These assemblies are communicated by bus 505.
In the present embodiment, in memorizer 502, storage has multiple program module, including operating system 506, network Communication module 507 and application program 508.
Processor 501 can read the various modules included by the application program in memorizer 502 (in figure not Illustrate) perform com component processing means various functions application and data process.In the present embodiment Processor 501 can be one, it is also possible to for multiple, and it can be CPU, processing unit/module, ASIC, Logic module or programmable gate array etc..
Wherein, operating system 506 can be: Windows operating system, Android operation system or Fructus Mali pumilae IPhone OS operating system.
Application program 508 comprises the steps that com component processing module 509.This com component processing module 509 Set of computer-executable instructions 509-1 and correspondence that each functional module in Fig. 4 shown device formed can be included Metadata and heuritic approach 509-2.These set of computer-executable instructions can be by described processor 501 Perform and complete method shown in Fig. 1 or the function of Fig. 4 shown device.
In the present embodiment, network communication interface 504 has matched with network communication module 507 COM group The transmitting-receiving of the various network signals of part processing means.
Display unit 503 has a display floater, has been used for input and the display of relevant information.
If this com component processing means is without communication requirement, it is also possible to do not include network communication interface 504 and Network communication module 507.
It addition, each functional module in each embodiment of the present invention can be integrated in a processing unit, Can also be that modules is individually physically present, it is also possible to two or more modules are integrated in a unit In.Above-mentioned integrated unit both can realize to use the form of hardware, it would however also be possible to employ SFU software functional unit Form realizes.The functional module of described each embodiment may be located at a terminal or network node, or also may be used To be distributed on multiple terminal or network node.
It addition, each embodiment of the present invention can be realized by the data processor that computer performs. Obviously, data processor constitutes the present invention.Additionally, the data being generally stored inside in a storage medium Processing routine by directly reading out storage medium or by program being installed or copying at data by program The storage device (such as hard disk and or internal memory) of reason equipment performs.Therefore, such storage medium is also constituted The present invention.Storage medium can use any kind of recording mode, and such as paper storage medium is (such as paper Band etc.), magnetic storage medium (such as floppy disk, hard disk, flash memory etc.), optical storage media (such as CD-ROM etc.), Magnetic-optical storage medium (such as MO etc.) etc..
Therefore present invention also offers a kind of storage medium, wherein storage has data processor, at these data Reason program is for performing any embodiment of said method of the present invention.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can be passed through Hardware completes, it is also possible to instructing relevant hardware by program and complete, described program can be stored in In a kind of computer-readable recording medium, storage medium mentioned above can be read only memory, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all at this Within bright spirit and principle, any modification, equivalent substitution and improvement etc. done, should be included in this Within the scope of bright protection.

Claims (10)

1. a The Component Object Model com component processing method, it is characterised in that at an application program Before process loads the described com component outside described process, the method includes:
Obtain the COM Agent components of described com component;
Described COM Agent components is loaded in described current process;
Described COM Agent components is registered in described process.
Method the most according to claim 1, it is characterised in that obtain the COM of described com component Agent components includes:
Search with described com component one by one under the file directory installing file place of described current process Corresponding described COM Agent components.
Method the most according to claim 1, it is characterised in that described COM Agent components is registered Include to described process:
Obtain interface the unknown IUnknown interface of described COM Agent components, and by described IUnknown Interface is registered to described process;
Obtain the class mark CLSID and interface identifier IID of described COM Agent components, and by described CLSID It is registered to described process with IID.
Method the most according to claim 1, it is characterised in that farther include:
Described COM Agent components is utilized to call the COM process that described com component is corresponding.
Method the most according to claim 4, it is characterised in that utilize described COM Agent components to adjust The COM process corresponding with described com component includes:
Trigger described COM Agent components and parameter is carried out row collection process;
Instruct described COM Agent components and the described parameter that row collection processes is sent to described com component correspondence COM process so that described COM process utilizes COM described in the parameter call that described row collection processes to enter The function generation execution result that journey is corresponding;
Receive described COM process and return described execution result.
6. a The Component Object Model com component processing means, it is characterised in that be applied in an application Process in load the client of described com component outside described process, this device includes:
Acquisition module, for obtaining the COM Agent components of described com component;
Load-on module, for loading described COM Agent components in described current process;
Registering modules, for being registered to described COM Agent components in described process.
Device the most according to claim 6, it is characterised in that described acquisition module, is further used for Search and described com component one_to_one corresponding under the file directory installing file place of described current process Described COM Agent components.
Device the most according to claim 6, it is characterised in that described Registering modules includes: the first note Book module and the second registration submodule;
Described first registration submodule, for obtaining the IUnknown interface of described COM Agent components, and Described IUnknown interface is registered to described process;
Described second registration submodule, for obtaining CLSID class mark and the IID of described COM Agent components Interface identifier, and described CLSID and IID is registered to described process.
Device the most according to claim 6, it is characterised in that farther include:
Calling module, for utilizing described COM Agent components to call the COM that described com component is corresponding Process.
Device the most according to claim 9, it is characterised in that described calling module includes:
Triggers module, is used for triggering described COM Agent components and parameter carries out row collection process;
Instruction submodule, is sent to institute for instructing described COM Agent components by the described parameter that row collection processes State the COM process that com component is corresponding, so that described COM process utilizes the parameter that described row collection processes Call function corresponding to described COM process and generate execution result;
Receive submodule, be used for receiving described COM process and return described execution result.
CN201610201537.3A 2016-04-01 2016-04-01 COM component processing method and device Active CN105893092B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610201537.3A CN105893092B (en) 2016-04-01 2016-04-01 COM component processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610201537.3A CN105893092B (en) 2016-04-01 2016-04-01 COM component processing method and device

Publications (2)

Publication Number Publication Date
CN105893092A true CN105893092A (en) 2016-08-24
CN105893092B CN105893092B (en) 2021-02-12

Family

ID=57011837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610201537.3A Active CN105893092B (en) 2016-04-01 2016-04-01 COM component processing method and device

Country Status (1)

Country Link
CN (1) CN105893092B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120233593A1 (en) * 2011-03-11 2012-09-13 Sanjeeb Sahoo Managed Enterprise Software Components as Dynamic Services
CN102780727A (en) * 2011-05-13 2012-11-14 湖南超视物联智能网络科技有限公司 Dynamic power management method of IOT (Internet of Things) terminal equipment
CN103577227A (en) * 2013-10-25 2014-02-12 北京奇虎科技有限公司 Method for loading plug-ins, browser and server
CN104216738A (en) * 2014-08-20 2014-12-17 北京奇艺世纪科技有限公司 Operation method and operation device of application program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120233593A1 (en) * 2011-03-11 2012-09-13 Sanjeeb Sahoo Managed Enterprise Software Components as Dynamic Services
CN102780727A (en) * 2011-05-13 2012-11-14 湖南超视物联智能网络科技有限公司 Dynamic power management method of IOT (Internet of Things) terminal equipment
CN103577227A (en) * 2013-10-25 2014-02-12 北京奇虎科技有限公司 Method for loading plug-ins, browser and server
CN104216738A (en) * 2014-08-20 2014-12-17 北京奇艺世纪科技有限公司 Operation method and operation device of application program

Also Published As

Publication number Publication date
CN105893092B (en) 2021-02-12

Similar Documents

Publication Publication Date Title
CN109325195B (en) Rendering method and system for browser, computer device and computer storage medium
CN105843741B (en) Information processing method and device for application program
US8788787B2 (en) Systems, methods and architecture for facilitating software access to acceleration technology
CN107133174A (en) Test case code automatically generating device and method
CN107526676B (en) Cross-system test method and device
CN105607986A (en) Acquisition method and device of user behavior log data
CN104866293B (en) A kind of method and device to Android application extensions for Microsoft Internet Explorer & Microsoft Office
WO2019085290A1 (en) Test preparation method and apparatus, terminal device, and storage medium
CN110727581B (en) Crash positioning method and electronic equipment
RU2010149889A (en) CONFIGURABLE PARTITIONING FOR PARALLEL DATA
CN112100060A (en) Operation environment self-adaption method and device and computer readable storage medium
US10970206B2 (en) Flash data compression decompression method and apparatus
CN108153745B (en) Application data calling method and application development system
CN111324373B (en) Method and device for sub-coding warehouse on multiple engineering files and computing equipment
CN115712566A (en) Method, device, equipment and storage medium for checking interface field
CN111309432B (en) Fault drilling method, device and system
CN105893092A (en) COM component processing method and device
CN107766230A (en) A kind of method and apparatus tested based on configuration file
CN106709338A (en) Program detection method and device
CN112073505B (en) Method for unloading on cloud server, control device and storage medium
CN111880803B (en) Software construction method and device applied to multiple platforms
CN110532186B (en) Method, device, electronic equipment and storage medium for testing by using verification code
CN113986723A (en) Mock testing method and related equipment thereof
CN114780208A (en) Method, system, device and storage medium for verifying backup validity of multi-platform virtual machine
CN106201691A (en) The dispatching method of a kind of network I/O intensive task and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221118

Address after: 1402, Floor 14, Block A, Haina Baichuan Headquarters Building, No. 6, Baoxing Road, Haibin Community, Xin'an Street, Bao'an District, Shenzhen, Guangdong 518100

Patentee after: Shenzhen Yayue Technology Co.,Ltd.

Address before: 2, 518044, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.