C Applications in Web Sites

This is a discussion on C Applications in Web Sites within the C Programming forums, part of the General Programming Boards category; I have a C program that accepts command line arguments. Now, I need to be able to pass the C ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    80

    Passing arguments to C from ColdFusion

    I have a C program that accepts command line arguments.

    Now, I need to be able to pass the C program arguments through Coldfusion on a Windows server.

    I'm new to programming and need to figure out how to make the C program accept and parse arguments from ColdFusion. Basically, I used getopt() and it works from the Command prompt. Will getopt() work to pass data from other sources other than the command prompt? Any help is greatly appreciated. I'm not sure if I'm asking the right questions, but I haven't been able to find much documentation/help.
    Last edited by jamez05; 08-12-2005 at 12:10 PM. Reason: Trying to clarify problem

  2. #2
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    yes, you can call the c app from a script, passing the output stream from the cfserver to it as the args.
    the simplest way:
    use the c app as a cgi and have the webserver call it with the output stream from the cfserver as the args when calling.

    else, run your query, with the output directed to the c app :
    query.bat > c.app

    in *x speak:
    query|app
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Why don't you just write your C app as a webapplication? C is not made for web apps so you probably shouldn't use it for that. Just rewrite what you what to happen in cold fusion.

  4. #4
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    orbitz,
    shhh, logic doesn't enter into the question obviously.

    you could even use dreamweaver to write a cold fusion based webapp.
    ( I know someone who loves the entire set of tools and how well they integrate together. )
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    80

    Thanks for your replies

    Thanks for the information.

    I will use the c app as a cgi. I cannot rewrite the code as a Web application because of its complexity. All of the documentation that I've found states that the functions work, but there is no explanation why. The original author, who is now dead, is the only person that understands what the functions do scientifically.

  6. #6
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    a very good reason to use it as cgi.

    you might also want to study the code in your spare time until you do understand it.

    then document it properly so that if there ever becomes a need for altering it, the current issue isn't in the way.
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. interact with web sites
    By awnjoor in forum C Programming
    Replies: 8
    Last Post: 07-26-2006, 07:10 PM
  2. Determining Latency of Web Sites
    By mmondok in forum C Programming
    Replies: 4
    Last Post: 04-23-2003, 06:47 AM
  3. Getting the ip address of web sites?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 03-17-2002, 11:16 PM
  4. Game Company Web Sites
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-17-2001, 08:32 PM

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