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. Regarding CHyperLink example

Regarding CHyperLink example

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 Posts 3 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.
  • H Offline
    H Offline
    H4u32
    wrote on last edited by
    #1

    Hello all, I have taken static text which work as hyperlink. It is working properly but I want to destroy dialog box on which i have put this static text. I am setting URL at run time when user click on it. so just I want to download specific file from URL and at the same time to unload dialog box. How couls i do this? Any help is greatly appreciated. Regards, Hemang

    I D 2 Replies Last reply
    0
    • H H4u32

      Hello all, I have taken static text which work as hyperlink. It is working properly but I want to destroy dialog box on which i have put this static text. I am setting URL at run time when user click on it. so just I want to download specific file from URL and at the same time to unload dialog box. How couls i do this? Any help is greatly appreciated. Regards, Hemang

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      You've got a bunch of ways to do this. Have a look at InternetOpenUrl, InternetReadFile, etc for getting the actual file. There are almost certainly articles in the internet section here on codeproject that do a better job too. How you implement it is up to you, but getting files over an unreliable connection is always hard. What if the user gave you a bad URL? Malformed? If you don't need immediate feedback, you could put the reading code into a thread, so you don't make the user wait a random time, and so on. Lots of different things for you to think about, and no trivial solutions, as the answers will depend heavily on the details of your application. Iain.

      Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

      H 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        You've got a bunch of ways to do this. Have a look at InternetOpenUrl, InternetReadFile, etc for getting the actual file. There are almost certainly articles in the internet section here on codeproject that do a better job too. How you implement it is up to you, but getting files over an unreliable connection is always hard. What if the user gave you a bad URL? Malformed? If you don't need immediate feedback, you could put the reading code into a thread, so you don't make the user wait a random time, and so on. Lots of different things for you to think about, and no trivial solutions, as the answers will depend heavily on the details of your application. Iain.

        Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

        H Offline
        H Offline
        H4u32
        wrote on last edited by
        #3

        I think I hadnt explained my problem exactly. I got Internet stuff almost done. Actually i want to unload particular dialog box when user click on Link text as I normally do with OK button. so how could i do this? Thanks, Hemang

        I 1 Reply Last reply
        0
        • H H4u32

          I think I hadnt explained my problem exactly. I got Internet stuff almost done. Actually i want to unload particular dialog box when user click on Link text as I normally do with OK button. so how could i do this? Thanks, Hemang

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          You'll need the SS_NOTIFY style on the static control to know when the use clicks on it. Then, in a handler for that click message, you can call EndDialog (SOMECODENUMBER); to finish the dialog. The DoModal () function will return the SOMECODENUMBER to any variable paying attention. In Win32, it's the same, excepy enddialog wants a window handle. Iain.

          Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

          1 Reply Last reply
          0
          • H H4u32

            Hello all, I have taken static text which work as hyperlink. It is working properly but I want to destroy dialog box on which i have put this static text. I am setting URL at run time when user click on it. so just I want to download specific file from URL and at the same time to unload dialog box. How couls i do this? Any help is greatly appreciated. Regards, Hemang

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Since the dialog class is likely derived from CDialog, why not just call EndDialog() like what happens when OK and Cancel are clicked?

            "Love people and use things, not love things and use people." - Unknown

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            H 1 Reply Last reply
            0
            • D David Crow

              Since the dialog class is likely derived from CDialog, why not just call EndDialog() like what happens when OK and Cancel are clicked?

              "Love people and use things, not love things and use people." - Unknown

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              H Offline
              H Offline
              H4u32
              wrote on last edited by
              #6

              I have referred to following article for my purpose. http://www.codeproject.com/KB/miscctrl/hyperlink.aspx[^] If you will have look at it then you can easily understand my problem. In this example there is one dialog named "HyperLink Sample". On this dialog there is static text named "mail me" and Ok button is there. This static text is associated with CHyperLink class. I want same functionality but just want to destroy "HyperLink Sample" dialog when someone clicks on it as well as it should work as HyperLink.

              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