Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running external applicati from inside Delphi+Intraweb + Bootstrap code
#1
I need help. In this link there is a code (working) that I did and possibly can be useful to people testing solutions http://www.cognitor.com.br/SWWWtest.zip (delphi + html / bootstrap ***). It has a simple menu and no database.
I made a site to be able to run, from inside my Delphi -IW-Bootstrap site, some electric calculations software  that I did for PCs in Delphi. The exe files will stay in the  same site. I need to run the EXE because to convert the calculation programs to IW would take about 6 months of work (they are complex and have many screens). I already know that the solution works because I tested here at home using Notepad, the Windows calculator and others.

It works but the problem is that I cannot make the Notepad screen to stay within the form of my application. They run but appears outside the form. I know that the problem is in the RunExternalSoft procedure that is in the NotepadT form. That's why I commented the line Winapi.Windows.SetParent line (fAppHandle, ????. Handle);
The help I need is for someone to correct the procedure so that the executable appears inside the form (blue part in figure http://www.cognitor.com.br/telasWWWtest.png )

If anyone can help me use the following sequence:
a) Download and unzip the SWWWtest.zip file. On my PC the directory is in C: \ SWWWtest
b) Compile the file TestingSite.dproj (I did it with Delphi Seattle)
c) When the screen appears there will be the left side menu with (Home, NotepadT and CalcT)
d) Click NotepadT and will appear a screen with an "open Software" button
e) Click on it and the Notepad will appear, but it will be running outside the form.
f) I want to correct this so that it appears in the blue area
g) Then click on the menu in CalcT. I need also help to know how to close NotepadT before opening CalcT. I do not know how to do this
h) Then CalcT will open but also out of the form. I need to correct

(***) to look better just copy the bower_components directory (from the course) into the wwwroot subdirectory. I retired so that this zipped file was light

thanks in advance
Reply
#2
Let me be clear on what you are trying to do.

It seems you want to run a Desktop application on the server, but have it appear as a UI in a region in the browser?

Or you just want to use the browser to launch a desktop app on the server?

Or?
Reply
#3
(09-06-2018, 06:08 PM)kudzu Wrote: Let me be clear on what you are trying to do.

It seems you want to run a Desktop application on the server, but have it appear as a UI in a region in the browser?

Or you just want to use the browser to launch a desktop app on the server?

Or?

Hi Kudzu
Referring to this figure http://www.cognitor.com.br/telasWWWtest.png

and to the complete source code I sent I have a a Intraweb + Bootstrap + IW application working. this application can open  external  exes . If I click the button NotepadT the code open the Notepad application in
RunExternalSoft('C:\Windows\System32\Notepad.exe');
My problem  is in the lower part  of the digure . I would like to have the Notepad screen located in the blue area ( and not in a (without control) position. I suppose that the problem occur because I am not putting the correct parameters in the line Winapi.Windows.SetParent (fAppHandle, ????? .handle);

I corrected the figure to put the explanations in English <<<<<<<<<
Reply
#4
You can't run a desktop application from the browser, if that's what you trying to do. Your IW application is starting it on the server side but you can't do that from the browser.
I think you are confusing what is server side and what is client (browser) side here....
Reply
#5
(09-06-2018, 10:12 PM)Alexandre Machado Wrote: You can't run a desktop application from the browser, if that's what you trying to do. Your IW application is starting it on the server side but you can't do that from the browser.
I think you are confusing what is server side and what is client (browser) side here....

Thank you Alexandre. My main question is not if I can run it. In the figure in the link I see it running. Just look it in the lower part the Notepad screen running. My problem is only that it is not appearing in the position I need (inside the blue part of the form). In the zip file in the post above the complete source code is there. It compiles and run.
Going now to your point, if I can't run a desktop application from the browser what is the “notepad” screen opened? 
Please explain me the following. The compiled file representing the code IW + Delphi + Bootstrap is an EXE file. If I put it in my Internet provider, it runs. If I put another exe like Notepad.exe why it would not run? I think that this depends only if the provider service permit or not to run an exe (my one permit). Please correct me if I am wrong.
Reply
#6
"IW + Delphi + Bootstrap is an EXE file."

It is a special EXE. IW handles all the web stuff. Notepad is not a web app, and has no abilities to communicate with the browser.

When you debug, the web server (your IW EXE) is running on the SAME PC as the browser. So of course when you launch notepad you will see it. But when the server is somewhere else, notepad will be on that server, not where the webbrowser is.
Reply
#7
(09-07-2018, 12:31 PM)kudzu Wrote: "IW + Delphi + Bootstrap is an EXE file."

It is a special EXE. IW handles all the web stuff. Notepad is not a web app, and has no abilities to communicate with the browser.

When you debug, the web server (your IW EXE) is running on the SAME PC as the browser. So of course when you launch notepad you will see it. But when the server is somewhere else, notepad will be on that server, not where the webbrowser is.

Thank you Kudzu. I  understood why it works here but it would not work when I put the IW.exe in my space in the provider (they accept exe) and the notepad.exe here in local.   Please answer one question more . I will do a trial like this next week. If I put my IW.exe site in the provider and I put the "notepad.exe" in the same directory of the provider , with the right address, do you think  Notepad will open (even not in the desired position of the screen)  ?
Reply
#8
You cannot run local EXEs on the client where the web browser is. That would be a serious security problem.

If you put notepad.exe on the sever, it will appear on the server if a desktop exists. It will never show on the client.
Reply
#9
(09-08-2018, 04:53 PM)kudzu Wrote: You cannot run local EXEs on the client where the web browser is. That would be a serious security problem.

If you put notepad.exe on the sever, it will appear on the server if a desktop exists. It will never show on the client.

Thank you and understood. I will start to convert my big code to IW+Delphi+Bootstrap. It will be hard work.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)