Home > Software engineering >  Can realize C [question] random logic implementation as the background, the front desk interface by
Can realize C [question] random logic implementation as the background, the front desk interface by

Time:09-29

As title, which is a project based on the MFC, and as to the user display and operation interface, is it possible to deal with by JS,
Means that the MFC project combined with JS, fusion in a project,
Is supposed to by MFC controls, CDC, implemented CClientDC to interface into JS,
This possible?
If you can how to implement?
Oneself also think it is torn, but still want to ask,

CodePudding user response:

[serious answer] can!!!!
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, changed its name to 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:

Search "VC and JavaScript interaction"

CodePudding user response:

Lz you this idea is very good, very wet, a lot of people have to do so,

CodePudding user response:

CodePudding user response:

Is certainly can, if one is to use the text as a medium for the transmission, if the large amount of data, and have change, the file is not so good, management and extension, see how to apply and demand,

CodePudding user response:

Can ah, hang a V8 engine, direct execution js

CodePudding user response:

Of course, more than a decade ago MFC added a CDHtmlDialog class, is used to make the WebUI,
, of course, also can put a Webbrowser or libcef on the window

CodePudding user response:

This idea is not pulled, there have been many such instances, the pattern of many desktop app is such, is now doing such a thing, CEF3 + MFC

CodePudding user response:

refer to the eighth floor starytx response:
this idea is not pulled, there are many such examples, many desktop app is such a model, is now doing such a thing, CEF3 + MFC


Is the interface display interface is JS written?
Is there a simpler example for reference,

CodePudding user response:

refer to the eighth floor starytx response:
this idea is not pulled, there are many such examples, many desktop app is such a model, is now doing such a thing, CEF3 + MFC


Is indeed, CEF3 already support V8 engine, the running efficiency should not be much of a problem, the elder brother of the star, I add you QQ, communicate together

CodePudding user response:

Is certainly can, interface implementation using webbrowser, backstage some logic in c + + implementation.
Then the c + + interact with js

CodePudding user response:

C + + with js interaction the idea, already has many people realize,
  • Related