justinbezanson

I have been playing with some C++ CGI lately and was wondering a couple things.

1.) What is the best way to maintain a CGI project Meaning, so far for every new application (every webform/page) I have to setup a new VS project. Surely there must be a better way. Can I setup VS to compile each .cpp into a seperate .exe

2.) Is Url Rewriting the only way to get the CGI application to execute without including the .exe on the end of the filename or is there some other way in IIS

Thanks for the help





Re: Visual C++ General c++ cgi

Simple Samples

Can you explain what is different about a CGI application that you need to ask about how to maintain CGI projects specifically I often see people asking about something specific when there is nothing different about the specific thing compared to other things in general. If there is something special about a CGI project that makes maintenance of it different from other projects then pleas explain the difference so I can provide a relevant answer.

Your question about how to execute a CGI application is off-topic for the MSDN VC forums. Most VC programmers are not likely to know the answer, since CGI is not often used in IIS. I think but I am not sure that there are many IIS installations that don't allow CGI.






Re: Visual C++ General c++ cgi

justinbezanson

The difference is that for every html form I want to process I need an .exe file. A project only compiles to 1 exe file so I need a new project for every page of the website. I sthere a way to set each .cpp in a project to compile to it's own exe file Or am I stuck with many projects inside a solution

CGI on IIS may be uncommon but is every easy, just set the site to allow scripts and executables. I have my own server so hosting limitations are not an issue. I prefer windows and would rather not install linux to run my CGI.

Well if this is off topic then where should it go It is VC++ CGI that I am writing and I didn't see a forum just for CGI. It is still pure C++ with an output type of text/html.





Re: Visual C++ General c++ cgi

Simple Samples

One thing that could help is to create multiple projects within a solution. You might have to redo what you do a couple of times to figure out how to do it the way you want it done, but it can help to organize things doing that. One thing that is a matter of presonal preference is the directory for each project. I will leave that for you to figure out. Something else that VS will do for you automatically is to set the output directory so that all the built exes will go into a common debug or release directory. As I said, it will take some time for you to become familiar with the details but it should help organize things.

Yes, CGI is easy but it is also inflexible, as you know. Another major disadvantage is security, but that is not a problem for you.

Perhaps you can parameterize some of the CGIs so that one common CGI project can process multiple types of forms, depending on options/parameters that are provided. You will need to design a way to get the options/parameters to the CGI program but that is acheivable.

Read CGI - Common Gateway Interface then read the documentation of CGI in the IIS documentation so you understand the specifics about CGIs in IIS.