Solved

How do I both use cgi32.bas and VB5CGI?

Posted on 1997-12-02
19
229 Views
Last Modified: 2008-02-01
How do I both use cgi32.bas and VB5CGI?
0
Comment
Question by:jfl
[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
  • 9
  • 9
19 Comments
 
LVL 8

Expert Comment

by:mrmick
ID: 1443334
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
ID: 1443335
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
ID: 1443336
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jfl
ID: 1443337
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
ID: 1443338
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
ID: 1443339
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
ID: 1443340
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
ID: 1443341
Sorry, I'm not rich in points!

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

Author Comment

by:jfl
ID: 1443342
Sorry, I'm not rich in points!

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

Expert Comment

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

Author Comment

by:jfl
ID: 1443344
Thanks a lot!

Jacob :)
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1443345
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
ID: 1443346
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
ID: 1443347
Do you think that it is possible to use both VB5CGI and Bob Denny's cgi32.bas ?
0
 

Author Comment

by:jfl
ID: 1443348
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
ID: 1443349
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
ID: 1443350
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
ID: 1443351
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
ID: 1443352
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses
Course of the Month3 days, 13 hours left to enroll

630 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