Solved

Visual C++ Application Called From Web Browser

Posted on 1997-06-10
5
189 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 100 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

749 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