We help IT Professionals succeed at work.

How do I both use cgi32.bas and VB5CGI?

jfl
jfl asked
on
Medium Priority
358 Views
Last Modified: 2008-02-01
How do I both use cgi32.bas and VB5CGI?
Comment
Watch Question

Commented:
Yes, I know about this also, I've got several apps I've written running on my server... assuming you're referring to Bob Denny's WinCGI.  However, this is much more complicated than your count question.

Do you have (close) access to a WinNT Server with IIS?

jfl

Author

Commented:
Yes, I'm referring to Bob Denny's WinCGI.

I have access to a WinNT running WebSite Pro 1.1

I can run my scripts through cgi-win but I'd like them to run through cgi-bin.

VB5CGI:
http://ourworld.compuserve.com/homepages/stsch/VB5-CGI.htm

Commented:
Create a sample app.  Include the CGI32.bas and a new module and name it "Sample.bas".  Set the project property "Startup Object" to "Sub Main".

Put in the New Module the following:

Public Sub CGI_Main()
  sendheader ("hello")
  Send ("<h1><strong>Test of CGI executable</strong></h1>")
  sendfooter
End Sub

Sub sendheader(Title As String)

    Send ("Content-type: text/html")
    Send ("")
    Send ("<HTML><HEAD><TITLE>" & Title & "</TITLE></HEAD>")
    Send ("<BODY>")

End Sub

Sub sendfooter()
    Send ("<HR>")
    Send ("</BODY></HTML>")
End Sub

Compile into an executable and put in the cgi-bin folder.  Execute it with a url and path to the exe created by compiling the sample project.

There may be other issues with WebSite Pro 1.1 - I use an ISAPI Filter to redirect to my WINCGI apps because I'm running WinNT with Internet Information Server.  I have no experience with WebSite Pro.


jfl

Author

Commented:
I know how to use cgi-win code, but I do not wan't to use cgi-win

If I use Send it will use cgi-win!

It must be possible to use cgi32.bas and VB5CGI.

Do you know about VB5CGI?

Commented:
Are we talking about the same thing?  WinCGI is the only kind of CGI VB is capable of because in standard CGI, the stream data is passed via stdin and stdout.  stdin and stdout are not available to VB and some other languages.  Bob Denny authored the WinCGI specification to overcome this limitation.

The above sample is 100% VB code.  "Send" is a public sub in the cgi32.bas module.  The above sample isn't a script.
jfl

Author

Commented:
VB5CGI can use stdin and stdout.

That's why I'm interested in that.
http://ourworld.compuserve.com/homepages/stsch/VB5-CGI.htm

Commented:
I wasn't aware of this possibility; however, you did say "cgi32.bas", and you did say "Yes, I'm referring to Bob Denny's WinCGI".

WinCGI and Standard CGI are completely different in their implementation.  I gave you what you asked for, which was quite a bit for 10 points.  Everything is perfectly accurate which I think you know since you've already worked with WinCGI (which I was unaware of until your last rejection).

What would have you expected?
jfl

Author

Commented:
Sorry, I'm not rich in points!

Can you help me with this? VB5CGI and cgi32.bas ?
jfl

Author

Commented:
Sorry, I'm not rich in points!

Can you help me with this? VB5CGI and cgi32.bas ?

Commented:
Give me a bit to download and take a look at the stuff.
jfl

Author

Commented:
Thanks a lot!

Jacob :)

Commented:
Post your email address, I've got it working somewhat.  It crashes though.  I'm currently isolating the cause of the crash.

Commented:
The sample app works "as is" in the documentation.  I set it up and it works great.  The only problem is that is the GetHitCounterInc method hangs.  After awhile, it gives up and terminates (just appeared to be a crash).  After checking into the problem I found it's trying to record hits in the registry.  The help file gives the key under which the hits are supposedly recorded but... after running it, the key wasn't created.  When I removed the GetHitCounterInc method from the sample, everything else worked like a charm.

The project compiled into only 8KB and is faster then WinCGI.

PS: I reported the bug to the object authors.

jfl

Author

Commented:
Do you think that it is possible to use both VB5CGI and Bob Denny's cgi32.bas ?
jfl

Author

Commented:
Do you think that it is possible to use both VB5CGI and Bob Denny's cgi32.bas ?

I thought that one could just change the Send function in cgi32.bas to use VB5CGI

Commented:
No, two completely different methods.  I think I know where you're getting at.  I'm not going to bother to redo any of my existing website because they both do the exact same thing and I’m not experiencing a speed problem right now.

But in future development, I'll probably utilize the VB5CGI because I won't need the ISAPI extension and it is faster because it eliminates the overhead of writing all the data to ini files before executing the script (and then reading the ini files from the CGI.exe).

Review the your rejected answer above to see the differences in WinCGI and CGI.  You could modify your code from WinCGI to CGI, but once you do, you won't need the cgi32.bas code because It is replaced by the VB5CGI object.  You must go one way or the other.

Commented:
I have never provided so much information on a 10 point question only to get reject with each offering.  Everything I've submitted has been correct.  Why don't you accept what I've offered?

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
jfl

Author

Commented:
I know that you have provided me with lots of help for my 10 points and I do appreciate it.

My question was:
How do I both use cgi32.bas and VB5CGI?

And now you tell me I can't, so now you have answered!

Commented:
please don't talk vb5cgi and wincgi, use Visual Interdev from
microsoft, the active server page  has all objects you want in
VB5CGI and WINCGI
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.