Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a C++ Builder function and passing parameters from a Javascript function
#6
(03-27-2019, 07:29 PM)amine1980 Wrote: I need to call a c++ builder function from a HTML button. 

Are we trying to over-complicate this?  You should not need to connect an HTML button with your C++Builder code.

With Intraweb, you would use an IWButton and simply put your code in the Click event on the server.  Intraweb handles all the plumbing to connect the button and server code.

However, a server function can't directly output to a browser display (can't render a showmessage onto the html form).   If I understand some of your earlier comments, it sounds like you want to run the browser and server on the same machine.  The code you provided would attempt to show a VCL form alongside/over/under the HTML form.  While you can run server and client on the same machine, it's a very bad idea to mix VCL forms with browser forms.  Go one way or the other.  Even if you get it to work, you might find one covering the other (vcl over browser or vice versa).

If you're going to use an HTML client then stick to Intraweb for all of it.  In Intraweb, place an IWButton on the form and call your C++Builder function from the OnClick or OnAsyncClick event in your application.  That's all.

To return a value (your DisplayNumber function), place the value in an existing container (maybe TIWLabel) on the form.  Also look into the TIWModalWindow sample if you want a "message box" type popup.

Sorry if I misunderstood what you are trying to do.

Dan
Reply


Messages In This Thread
RE: Calling a C++ Builder function and passing parameters from a Javascript function - by DanBarclay - 03-29-2019, 05:27 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)