Solved

How do I both use cgi32.bas and VB5CGI?

Posted on 1997-12-02
19
199 Views
Last Modified: 2008-02-01
How do I both use cgi32.bas and VB5CGI?
0
Comment
Question by:jfl
  • 9
  • 9
19 Comments
 
LVL 8

Expert Comment

by:mrmick
Comment Utility
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?

0
 

Author Comment

by:jfl
Comment Utility
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
0
 
LVL 8

Expert Comment

by:mrmick
Comment Utility
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.


0
 

Author Comment

by:jfl
Comment Utility
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?
0
 
LVL 8

Expert Comment

by:mrmick
Comment Utility
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.
0
 

Author Comment

by:jfl
Comment Utility
VB5CGI can use stdin and stdout.

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

Expert Comment

by:mrmick
Comment Utility
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?
0
 

Author Comment

by:jfl
Comment Utility
Sorry, I'm not rich in points!

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

Author Comment

by:jfl
Comment Utility
Sorry, I'm not rich in points!

Can you help me with this? VB5CGI and cgi32.bas ?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 8

Expert Comment

by:mrmick
Comment Utility
Give me a bit to download and take a look at the stuff.
0
 

Author Comment

by:jfl
Comment Utility
Thanks a lot!

Jacob :)
0
 
LVL 8

Expert Comment

by:mrmick
Comment Utility
Post your email address, I've got it working somewhat.  It crashes though.  I'm currently isolating the cause of the crash.
0
 
LVL 8

Expert Comment

by:mrmick
Comment Utility
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.

0
 

Author Comment

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

Author Comment

by:jfl
Comment Utility
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
0
 
LVL 8

Expert Comment

by:mrmick
Comment Utility
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.

0
 
LVL 8

Accepted Solution

by:
mrmick earned 10 total points
Comment Utility
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?
0
 

Author Comment

by:jfl
Comment Utility
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!
0
 

Expert Comment

by:stelau
Comment Utility
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
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now