?
Solved

Visual C++ Application Called From Web Browser

Posted on 1997-06-10
5
Medium Priority
?
193 Views
Last Modified: 2013-12-25
I have a VC++ 5.0 application that retrieves and displays information from an Oracle database through ODBC.  I need a fast and easy way to be able to call the executable on the client from a web page.  The executable requires 5 parameters which I would like to pass in from input from the web page.  

Database - Oracle 7.3
OS - NT 4.0 Workstation/Server
browser - Netscape/Microsoft IE
web server - not yet determined, perhaps Microsoft IIS,  

Can I do this through a CGI script or a plug-in or how?
0
Comment
Question by:fitzg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Expert Comment

by:icd
ID: 1828194
The simplest way would be to write a script that interfaces to your program. To do this however there are a number of requirements.

(1) Your program must accept input as command line arguments.
(2) Your program must output to stdout device.

If your program accepts input from stdin rather than command line arguments then the problem is a bit more difficult, you need to open a pipe to the program to feed the parameters in. Possible on UNIX but a bit more difficult on NT (at least for me!).

If the program meets these requirements then you can write a bit of code something like:-

@output = `yourprog $in{par1} $in{par2}`;

This will feed the command line arguments par1 and par2 (taken from an input form that calls your script) and puts the results of your program into the @output array. You can then process the output or just print it as part of an html document.
0
 

Expert Comment

by:aviad
ID: 1828195
Why was icd's answer rejected? I think it is quite adequate.
0
 
LVL 5

Expert Comment

by:icd
ID: 1828196
If fitzg would care to comment then perhaps he/she would be more likely to receive an answer that *was* acceptable.
0
 
LVL 7

Accepted Solution

by:
faster earned 400 total points
ID: 1828197
Icd's answer is workable.  I guess maybe you don't like to write another script (which requires that you learn some Perl, although it is quite simple).

Another solution is that you add the CGI support directly to your VC++ program, this requires you do the following:

1. Retrive the parameters.
1) Get the value of environment variable "CONTENT_LENGTH"
2) Read from stdin, the size of which determined by "CONTENT_LENGTH"
3) You will get something like "param1=value1&param2=value2...", parse this buffer and do the url unescaping to get your parameters.

2. Do whatever processing you need.

3. Write the output to the stdout, starting with "Content-type: text/html\r\n\r\n", followed by a html-formatted result.







0
 

Author Comment

by:fitzg
ID: 1828198
With our time constraints, we didn't want to write another script.  I think a combination of both answers from icd and faster is the answer for us.  (Is it possible to split the points for them?)  Thanks.
0

Featured Post

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question