Home > Software engineering >  How to import the c win32 DLL files to COM components (ATL) calls for Java language
How to import the c win32 DLL files to COM components (ATL) calls for Java language

Time:09-16

VS2010 wrote a Win32 DLL, but the customer can only through the COM component to invoke the c + + DLL, before contact with COM components, COM components, please can encapsulate before the DLL into the new COM DLL using? Before this DLL. H and the CPP file, also more complex, is not a simple input and output, so please under the guidance of the great god, how can I change this DLL into the form of com components, can say the specific steps? In this thankful

CodePudding user response:

In the new com call the old DLL

CodePudding user response:

reference 1st floor jacksonfan response:
call the old in the new com DLL

How in the new com callback win32 DLL, convenient for advice?

CodePudding user response:

Don't be A language code is modified to B language code busywork,
Also don't use A language code to directly invoke B language code base, this complicated things so easy to get wrong,
Just make A, B language code of input and output is redirected to A text file, or modify A, B language code let it through text file input and output,
Can easily make A, B coordination between the two languages,
For example:
A will request data written to A file a.t xt, renamed after finish aa. TXT
B find aa. TXT, read its contents, call the corresponding function, and writes the results file b.t xt, after finish delete aa. TXT, then b.t xt renamed bb. TXT
Found A bb. TXT, read the content, after finish delete bb. TXT
Above can be replaced by any kind of A language or development environment, B can be replaced by any kind of with the development of A different language or development environment,
Unless A or B does not support to determine whether A file exists, file read and write and file name,
But who can name does not support to determine whether a file exists, file read and write and file name for the development of language or development environment?
Can put the temporary files on the RamDisk efficiency decrease wear disk,
Data structure is very complex, a text file format problems refer to a json or XML

The communication methods between the temporary text file sharing this process there are plenty of advantages, compared to other method only listed below I can think of now:
Loose coupling between process,
Can be on the same machine, process, also can cross machine, across the operating system, hardware platform, and even multinational,
, convenient debugging, and monitoring, only let the third party or artificial view the temporary text files,
Switch, convenient online service, need to delete or create the temporary text files,
, is convenient to realize distributed and load balancing,
Services to provide convenient, queue, queue is full and it is almost impossible to happen (unless the hard disk space full)
DE...

"Across different languages, machine, across the operating system, hardware platform, multinational, cross *. *" misery,
Back is "the use of Shared a plain text file information communication" of the shore!

CodePudding user response:

APP wizard new MFC dialog project, select the automation, the wizard will generate a lot of code, and then in the class view will be more than one interface class, add the external interface of attributes and methods, and the function of the associated related implementation

CodePudding user response:

Yes, it is automated, ActiveX in c + + development, then VB, Java can access

CodePudding user response:

Java Jacob can adjust the idispatch interface, but seems to have no the custom interface
Python comtypes open source libraries can be pure COM interface, but want to use their own tools to sweep the DLL or TLB and exported as a python class
Java call python method is much more

CodePudding user response:

Also can put your call demand, encapsulated into IDispatch compatible with ATL DLL component, called the COM DLL, to adjust with Jacob

CodePudding user response:

Encapsulates a universal interface, and then through the lua calls

CodePudding user response:

Swig, also can do a call interface socket
Or thrift interface such as COM pit

CodePudding user response:

3/f a.t xt b.t xt ideally, should be ok, if multiple threads in the work, are occupied, delete, friends,

CodePudding user response:

Old DLL source files are, why not continue to increase the function???
  • Related