Solved

CGI wit VB 4

Posted on 1998-06-23
6
448 Views
Last Modified: 2010-05-03
I have got a PWS installed and have got the source code of CGI32.bas(This module initializes the CGI environment).But the problem is that Iam able to get a messagebox open through the remote PC but when it comes to sending back the HTML it gives an error saying HTTP headers not send.Iam using the PWS shipped with windows-95.Is it compatible for CGI?Another problem is that most probably the CGI data file which should have all the details of CGI to be executed is not being send as Iam not able to trap the command line arguments.Can you please help me out?If possible please suggest some books on CGI in VB.
0
Comment
Question by:zeus_akkali
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:kesonline
ID: 1464079
Ok - could you send me CGI32.bas and your project? I'll try to debug it for you. Are you sending "Content-type: text/html" and a blank line afterwards before you response? My email address is ben@kescom.net
0
 
LVL 6

Accepted Solution

by:
alamo earned 50 total points
ID: 1464080
Hi, I saw the question you just posted in CGI and saw it was a duplicate of this one, which I hadn't noticed earlier. I'll explain what's happening here and leave the other one open. You will probably want to delete it.

CGI32.bas is an interface module for a special kind of CGI, called WinCGI. WinCGI was invented because normal CGI uses STDIN and STDOUT to communicate with the web server, but VB programs are visual and almost never use STDIN and STDOUT (it's quite tricky). Under WinCGI the server writes the arguments to a file which CGI32.bas reads, and your program writes the web page output to a file which the server reads and sends back to the browser.

WinCGI is basically obsolete now. IIS doesn't support WinCGI, so there's no chance you can get your program to work with CGI32.bas.

However - it's tricky to do real CGI with VB, but not impossible, and someone has done the work and built a module so that you can do CGI from VB easily. It's called CGI4VB, and you need to replace CGI32 with it. I found a link to CGI4VB at http://pw2.netcom.com/~obrienk/index.html by doing a web search. Go there and get it, and you will be able to get your program working.

As to a book - I haven't read any but have heard there's a book "CGI programming
with Visual Basic 5". But search the web, there's a lot of info out there.

Good luck!
0
 
LVL 1

Author Comment

by:zeus_akkali
ID: 1464081
Alamao ,That was very nice of you that you cleared my doubt in no time.I just want to know one more thing as to If IIS does not support WinCGI then how is CGI programming done in Win95 environment.I have downloaded the cgi4vb.zip and after trying it out I will grade this question. thanks any way..

Bye,
Zeus.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 6

Expert Comment

by:alamo
ID: 1464082
Ah, sorry if I wasn't clear -

IIS supports standard CGI, and cgi4vb makes your VB program compatible with standard CGI.

Most other languages commonly used for CGI (such as compiled C and perl) never had a problem with standard CGI, even under Win95, because they weren't visual languages. It was only VB that had the problem. And now that cgi4vb has solved the problem for VB, the WinCGI standard has died since it's no longer necessary.

Glad I could help!
0
 
LVL 6

Expert Comment

by:alamo
ID: 1464083
Hi zeus_akkali... could you grade this please? Thanks!
0
 
LVL 1

Author Comment

by:zeus_akkali
ID: 1464084
Soory alamo
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA combine two working workbooks 8 60
Macro Excel - Multiple If conditions 2 81
vbModal 12 57
Export Data to Different .csv Files 26 114
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

791 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