[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Visual C++ Application Called From Web Browser

Posted on 1997-06-10
5
Medium Priority
?
194 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
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 how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

650 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