C++ program with web frontend

This is a discussion on C++ program with web frontend within the C++ Programming forums, part of the General Programming Boards category; Hi everyone, I've got a problem and do not know how to go about solving it. If anybody has any ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    3

    C++ program with web frontend

    Hi everyone,

    I've got a problem and do not know how to go about solving it.
    If anybody has any ideas, that would be great!!

    There is a translator program written in C++ that, when executes, reads in a txt file, and then processes it and outputs a txt file.

    What I want to do is design a web front end so that for instance, users could enter txt into a box on a website, and then submit. This would use the C++ program to translate it, and then show up on a webpage for the user to see!

    How could I go about doing this?
    Would your suggestion also apply for C programs too?

    Thanks in advance!
    Nik

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    You mean to translate it into another language?

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    3
    Yeah!

    Its a Latin translator (I havnt developed this prgram, but my project is actaully developing this web interface for it)

  4. #4
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    well you can easily do this with JAVA.... using jini... But this is on the higher end of Java for which you have to learn a lot of stuff...

  5. #5
    ResurgentBarbecue UnclePunker's Avatar
    Join Date
    May 2002
    Posts
    128
    You could use php to take the text from the internet and pass it to the C++ program, I'm pretty sure of it anyway, and if your good with C++ PHP looks nearly exactly the same.
    Compiler == Visual C++ 6.0
    "Come Out Fighting."

  6. #6
    Registered User
    Join Date
    Jan 2003
    Posts
    1

    Lightbulb

    I did somthing like this on Linux this last weekend.

    Basic outline.

    Write a C/C++ "CGI" text based program ie DOS/Linux

    It must

    1. Read from stin 'web POST methode' untill buffer is emty then
    continue with the program.
    2. Write result from POST method of web page to a tempory text
    file on the server.
    3. Call TRANSlator program.
    4. Wait for end of process.
    5. Read results from output file.
    6. Write output with HTML formating to stdout.
    7. Exit

    Note.
    Data comming from the web via the POST methode appears to come in with the StdIn stream to your CGI/exe.

    Data comming from the web via URL methode comes in via the programs command line paramaters. ie
    http://myserver.some.net/cgi-bin/test.exe?MyText could pass the paramater 'MyTest' to the program.

    Post methode appears to be the better methode for large text fields.

    I have a demo web page and the source code to demonstrate both methodes of passing data from the web to a exe on the server. Email me if you would like it.

    My code was writen on linux, but should compile on other platforms with c/c++

    I am learning !! It is working for me, but I have large gaping holes in my C++ knowlage. Result may/can/will change based on OS / Web server / C compiler / Security settings.

    Regards
    ERIC

  7. #7
    efea
    Guest
    Bleh, CGI, havn't we progressed? I say go with PHP. Read in data, store in temp file. Run your program, read output file, send to output, delete files.

  8. #8
    Registered User
    Join Date
    Jan 2003
    Posts
    3
    ELECTRON :
    thanks for the detailed reply, I think I get the idea of what you are describing.

    I think the main problem is visualising how I would actually implement this (i.e. code samples, etc..!!)

    I am definately interested in looking at the program that you have developed, i just cant email you. Plz send me a private message, and I'll reply givin you my email?!


    EFEA :
    Thanks for the suggestion... do you know of any similar projects that use PHP to connect with a c/c++ program?? I have tried searchin for something similar to this problem, but didnt have any luck.

    I beleive the original C++ program is actually written under linux.

    Thanks

  9. #9
    Registered User
    Join Date
    Feb 2002
    Posts
    98
    you would be better of using visual basic, and make a active x control, if you need to implement the c++ part into it, use the ole control

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 11:58 PM
  2. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  3. Launching web documents through a program?
    By carey_sizer in forum C Programming
    Replies: 3
    Last Post: 09-08-2004, 07:51 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21