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. Question

Question

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 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.
  • A Offline
    A Offline
    Alex_Y
    wrote on last edited by
    #1

    If call function and I want that function work not more than 3 sec. how can force to softly exit from it if 3 sec expires. Function not in my code I need somthing similiar to SendMessageTimeOut(...) :)

    M D 2 Replies Last reply
    0
    • A Alex_Y

      If call function and I want that function work not more than 3 sec. how can force to softly exit from it if 3 sec expires. Function not in my code I need somthing similiar to SendMessageTimeOut(...) :)

      M Offline
      M Offline
      Marc Soleda
      wrote on last edited by
      #2

      Alex_Y wrote: Function not in my code I need somthing similiar to SendMessageTimeOut(...) Where's it? In a library? in another process? Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.

      A 1 Reply Last reply
      0
      • A Alex_Y

        If call function and I want that function work not more than 3 sec. how can force to softly exit from it if 3 sec expires. Function not in my code I need somthing similiar to SendMessageTimeOut(...) :)

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

        Start up a secondary thread that will call that function. Then call WaitForSingleObject() specifying 3000 for the timeout interval. If the return value is WAIT_TIMEOUT, then you know that the function is still running.


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        A 1 Reply Last reply
        0
        • M Marc Soleda

          Alex_Y wrote: Function not in my code I need somthing similiar to SendMessageTimeOut(...) Where's it? In a library? in another process? Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.

          A Offline
          A Offline
          Alex_Y
          wrote on last edited by
          #4

          I actualy subclassing WinProc of ActiveX control. This is bad written control which I don't have source code. Now some times control recieve message from parent and opens socket connection. All my code freeze until ActiveX finish connection. I already make my own UI thread but still parent window calls child windows inluding activex directy via WinProc. So I subclass ActiveX find bad message but I want timmed it. If it not done ReplyMessage(TRUE) and escape. I already tryied CallWinowsProc in sepparete worker thread. Doesn't help. Thats my story. Thanks for reply. :)

          1 Reply Last reply
          0
          • D David Crow

            Start up a secondary thread that will call that function. Then call WaitForSingleObject() specifying 3000 for the timeout interval. If the return value is WAIT_TIMEOUT, then you know that the function is still running.


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

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

            I actualy subclassing WinProc of ActiveX control. This is bad written control which I don't have source code. Now some times control recieve message from parent and opens socket connection. All my code freeze until ActiveX finish connection. I already make my own UI thread but still parent window calls child windows inluding activex directy via WinProc. So I subclass ActiveX find bad message but I want timmed it. If it not done ReplyMessage(TRUE) and escape. I already tryied CallWinowsProc in sepparete worker thread. Doesn't help. Thats my story. Thanks for reply. :)

            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