Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to open localhost in MFC? (Very Urgent...........) [modified]

How to open localhost in MFC? (Very Urgent...........) [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
11 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AnithaSubramani
    wrote on last edited by
    #1

    Hi All, Im having sam.txt file in my Tomcat path.I need to download this file throw IE or Mozilla Firefox using MFC. URL is: http://localhost:8080/sample/Upload\_Files/sam.txt I dont know how to open throw MFC. Pls Help me........... Thanks & Regards, Anitha

    modified on Wednesday, December 17, 2008 2:12 AM

    L S M _ H 6 Replies Last reply
    0
    • A AnithaSubramani

      Hi All, Im having sam.txt file in my Tomcat path.I need to download this file throw IE or Mozilla Firefox using MFC. URL is: http://localhost:8080/sample/Upload\_Files/sam.txt I dont know how to open throw MFC. Pls Help me........... Thanks & Regards, Anitha

      modified on Wednesday, December 17, 2008 2:12 AM

      L Offline
      L Offline
      L Madhavan
      wrote on last edited by
      #2

      I'm not sure if I got you right, but something like this will launch the page in your default browser:

      ShellExecute(NULL, NULL, "http://localhost:8080/sample/Upload\_Files/sam.txt", NULL, NULL, SW_SHOWNORMAL);

      Note that you don't need MFC for this - see ShellExecute[^] at MSDN.

      A 1 Reply Last reply
      0
      • A AnithaSubramani

        Hi All, Im having sam.txt file in my Tomcat path.I need to download this file throw IE or Mozilla Firefox using MFC. URL is: http://localhost:8080/sample/Upload\_Files/sam.txt I dont know how to open throw MFC. Pls Help me........... Thanks & Regards, Anitha

        modified on Wednesday, December 17, 2008 2:12 AM

        S Offline
        S Offline
        Stuart Dootson
        wrote on last edited by
        #3

        This might/ought to work (this page[^] supports my supposition) ::ShellExecute(0, _T("open"), _T("http://localhost:8080/sample/Upload_Files/sam.txt"), 0, 0, 0);

        1 Reply Last reply
        0
        • A AnithaSubramani

          Hi All, Im having sam.txt file in my Tomcat path.I need to download this file throw IE or Mozilla Firefox using MFC. URL is: http://localhost:8080/sample/Upload\_Files/sam.txt I dont know how to open throw MFC. Pls Help me........... Thanks & Regards, Anitha

          modified on Wednesday, December 17, 2008 2:12 AM

          M Offline
          M Offline
          Malli_S
          wrote on last edited by
          #4

          You can launch the IE/Mozilla application through CreateProcess() or ShellExecute() by passing your file path as parameter. The IE/Mozilla will open it for you.

          -Malli...! :rose:****

          1 Reply Last reply
          0
          • L L Madhavan

            I'm not sure if I got you right, but something like this will launch the page in your default browser:

            ShellExecute(NULL, NULL, "http://localhost:8080/sample/Upload\_Files/sam.txt", NULL, NULL, SW_SHOWNORMAL);

            Note that you don't need MFC for this - see ShellExecute[^] at MSDN.

            A Offline
            A Offline
            AnithaSubramani
            wrote on last edited by
            #5

            Hi, I need to download this file.

            L S 2 Replies Last reply
            0
            • A AnithaSubramani

              Hi All, Im having sam.txt file in my Tomcat path.I need to download this file throw IE or Mozilla Firefox using MFC. URL is: http://localhost:8080/sample/Upload\_Files/sam.txt I dont know how to open throw MFC. Pls Help me........... Thanks & Regards, Anitha

              modified on Wednesday, December 17, 2008 2:12 AM

              _ Offline
              _ Offline
              _AnsHUMAN_
              wrote on last edited by
              #6

              AnithaSubramani wrote:

              (Very Urgent...........)

              Why?

              AnithaSubramani wrote:

              .I need to download this file throw IE or Mozilla Firefox using MFC.

              Is it mandatory to download the file that way...

              You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

              A 1 Reply Last reply
              0
              • A AnithaSubramani

                Hi All, Im having sam.txt file in my Tomcat path.I need to download this file throw IE or Mozilla Firefox using MFC. URL is: http://localhost:8080/sample/Upload\_Files/sam.txt I dont know how to open throw MFC. Pls Help me........... Thanks & Regards, Anitha

                modified on Wednesday, December 17, 2008 2:12 AM

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                AnithaSubramani wrote:

                Hi, I need to download this file.

                Do you need to CInternetFile class?

                Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                1 Reply Last reply
                0
                • A AnithaSubramani

                  Hi, I need to download this file.

                  L Offline
                  L Offline
                  L Madhavan
                  wrote on last edited by
                  #8

                  Maybe the CInternetSession[^] class will help you. The OpenURL function of this class opens any Internet file and returns a CStdioFile object, which you can use as a normal file object. If you want to save the file, simply read from this file and write into another file.

                  1 Reply Last reply
                  0
                  • A AnithaSubramani

                    Hi All, Im having sam.txt file in my Tomcat path.I need to download this file throw IE or Mozilla Firefox using MFC. URL is: http://localhost:8080/sample/Upload\_Files/sam.txt I dont know how to open throw MFC. Pls Help me........... Thanks & Regards, Anitha

                    modified on Wednesday, December 17, 2008 2:12 AM

                    J Offline
                    J Offline
                    Jijo Raj
                    wrote on last edited by
                    #9

                    Have a look at URLDownloadToFile()[^]. Well, check out this article too - Using Internet Explorer to download files for you[^]. Regards, Jijo.

                    _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

                    1 Reply Last reply
                    0
                    • A AnithaSubramani

                      Hi, I need to download this file.

                      S Offline
                      S Offline
                      Stuart Dootson
                      wrote on last edited by
                      #10

                      In that case, see this page[^]

                      1 Reply Last reply
                      0
                      • _ _AnsHUMAN_

                        AnithaSubramani wrote:

                        (Very Urgent...........)

                        Why?

                        AnithaSubramani wrote:

                        .I need to download this file throw IE or Mozilla Firefox using MFC.

                        Is it mandatory to download the file that way...

                        You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

                        A Offline
                        A Offline
                        AnithaSubramani
                        wrote on last edited by
                        #11

                        Yes

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups