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#
  4. Problem with delegates

Problem with delegates

Scheduled Pinned Locked Moved C#
helpcomquestion
10 Posts 4 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.
  • J Offline
    J Offline
    Jacobb Michael
    wrote on last edited by
    #1

    Hi all, I have seen a solution,which deals with File download in web browser. and the bellow code gives error can some one help me what is the problem here...

    //make a thread to look for the dialog
    Thread workThread = new Thread(delegate()
    {
    FindDownloadDialogWindow("#32770", "File Download", 120,
    });

    From here i tried download dialogue thanks

    K L C 4 Replies Last reply
    0
    • J Jacobb Michael

      Hi all, I have seen a solution,which deals with File download in web browser. and the bellow code gives error can some one help me what is the problem here...

      //make a thread to look for the dialog
      Thread workThread = new Thread(delegate()
      {
      FindDownloadDialogWindow("#32770", "File Download", 120,
      });

      From here i tried download dialogue thanks

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      What is the error?

      1 Reply Last reply
      0
      • J Jacobb Michael

        Hi all, I have seen a solution,which deals with File download in web browser. and the bellow code gives error can some one help me what is the problem here...

        //make a thread to look for the dialog
        Thread workThread = new Thread(delegate()
        {
        FindDownloadDialogWindow("#32770", "File Download", 120,
        });

        From here i tried download dialogue thanks

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I hope you don't mean this:

        Thread workThread = new Thread(delegate()
        {
        FindDownloadDialogWindow("#32770", "File Download", 120**);**
        });

        J 1 Reply Last reply
        0
        • L Lost User

          I hope you don't mean this:

          Thread workThread = new Thread(delegate()
          {
          FindDownloadDialogWindow("#32770", "File Download", 120**);**
          });

          J Offline
          J Offline
          Jacobb Michael
          wrote on last edited by
          #4

          Hi thanks and when i build (C#) the following error comes, i am not familiar with delegates can you guide me The name 'FindDownloadDialogWindow' does not exist in the current context do i need to declare this or what to do. thanks...

          L 1 Reply Last reply
          0
          • J Jacobb Michael

            Hi all, I have seen a solution,which deals with File download in web browser. and the bellow code gives error can some one help me what is the problem here...

            //make a thread to look for the dialog
            Thread workThread = new Thread(delegate()
            {
            FindDownloadDialogWindow("#32770", "File Download", 120,
            });

            From here i tried download dialogue thanks

            K Offline
            K Offline
            Keith Barrow
            wrote on last edited by
            #5

            Your code produces syntax errors. I suggest you try the code harold posted. If you still get an error, try calling FindDownloadDialogWindow without the thread, this will help you determine whether your call to the method is OK, then add back the delegate call.

            J 1 Reply Last reply
            0
            • J Jacobb Michael

              Hi thanks and when i build (C#) the following error comes, i am not familiar with delegates can you guide me The name 'FindDownloadDialogWindow' does not exist in the current context do i need to declare this or what to do. thanks...

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              jasome wrote:

              do i need to declare this or what to do.

              Obviously. The function is only described, not actually given, on that blog. It's not to hard to write it, but you seem more like the copy&paste kind of "programmer" to me. No offense, but matching up parenthesis and adding missing semicolons is not exactly high-level. Good luck.

              1 Reply Last reply
              0
              • K Keith Barrow

                Your code produces syntax errors. I suggest you try the code harold posted. If you still get an error, try calling FindDownloadDialogWindow without the thread, this will help you determine whether your call to the method is OK, then add back the delegate call.

                J Offline
                J Offline
                Jacobb Michael
                wrote on last edited by
                #7

                Hi thanks Even if i call FindDownloadDialogWindow outside the thread also it gives the same error. do you have any idea of which namespace or dll consists this FindDownloadDialogWindow function. thanks

                K 1 Reply Last reply
                0
                • J Jacobb Michael

                  Hi thanks Even if i call FindDownloadDialogWindow outside the thread also it gives the same error. do you have any idea of which namespace or dll consists this FindDownloadDialogWindow function. thanks

                  K Offline
                  K Offline
                  Keith Barrow
                  wrote on last edited by
                  #8

                  You'll need to write the method yourself. I suggest you take a look at http://msdn.microsoft.com/en-us/library/aa288436(VS.71).aspx[^]

                  J 1 Reply Last reply
                  0
                  • K Keith Barrow

                    You'll need to write the method yourself. I suggest you take a look at http://msdn.microsoft.com/en-us/library/aa288436(VS.71).aspx[^]

                    J Offline
                    J Offline
                    Jacobb Michael
                    wrote on last edited by
                    #9

                    Thanks i do try...!

                    1 Reply Last reply
                    0
                    • J Jacobb Michael

                      Hi all, I have seen a solution,which deals with File download in web browser. and the bellow code gives error can some one help me what is the problem here...

                      //make a thread to look for the dialog
                      Thread workThread = new Thread(delegate()
                      {
                      FindDownloadDialogWindow("#32770", "File Download", 120,
                      });

                      From here i tried download dialogue thanks

                      C Offline
                      C Offline
                      carlecomm
                      wrote on last edited by
                      #10

                      Hey, for example: //new Thread t= new Thread (new ThreadStart(MyFunction)); t.Start(); // MyDelegate dele = new MyDelegate (FindDownloadDialogWindow ); dele.BeginInvoke("#32770", "File Download", 120); void FindDownloadDialogWindow(string handle, string tileText, int num);

                      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