Solved

How do I both use cgi32.bas and VB5CGI?

Posted on 1997-12-02
19
204 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
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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2013 combo box not working 3 38
VB6 - Compare and highlight cell not the same 3 42
SLMGR Switches Are Not Working On KMS Host 3 67
Child Form in front 4 37
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

919 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

19 Experts available now in Live!

Get 1:1 Help Now