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. Invalid URI: The format of the URI could not be determined

Invalid URI: The format of the URI could not be determined

Scheduled Pinned Locked Moved C#
debugginghelpquestion
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
    Alan Balkany
    wrote on last edited by
    #1

    The above message is followed by: "Control.Invoke failed". Baffling! This is a desktop application, so why are URI's even involved? Here's how the delegate is created:

            EventHandler printButton = btnPrint\_Click;
            HighVoltage hv = new HighVoltage(m\_Printer.PrintController,
                s\_SchedulerController, printButton);
            hv.ShowDialog();
    

    Here's how it's passed to the class:

        public HighVoltage(Mercury.Controller.Print.PrintController thePrintController,
            SchedulerController theSchedCtler, EventHandler thePrintButton)
        {
            InitializeComponent();
    
            printButton = thePrintButton;
            ...
    

    Here's how it's used:

                Utils.InvokeDelegateOnCorrectThread(printButton, new object\[\] { null, null });
    

    This eventually reaches:

                return control.Invoke(\_delegate, args);
    

    where the error happens. The contents of all the variables look reasonable in the debugger. Any ideas what could be causing this? Thanks!

    S 1 Reply Last reply
    0
    • A Alan Balkany

      The above message is followed by: "Control.Invoke failed". Baffling! This is a desktop application, so why are URI's even involved? Here's how the delegate is created:

              EventHandler printButton = btnPrint\_Click;
              HighVoltage hv = new HighVoltage(m\_Printer.PrintController,
                  s\_SchedulerController, printButton);
              hv.ShowDialog();
      

      Here's how it's passed to the class:

          public HighVoltage(Mercury.Controller.Print.PrintController thePrintController,
              SchedulerController theSchedCtler, EventHandler thePrintButton)
          {
              InitializeComponent();
      
              printButton = thePrintButton;
              ...
      

      Here's how it's used:

                  Utils.InvokeDelegateOnCorrectThread(printButton, new object\[\] { null, null });
      

      This eventually reaches:

                  return control.Invoke(\_delegate, args);
      

      where the error happens. The contents of all the variables look reasonable in the debugger. Any ideas what could be causing this? Thanks!

      S Offline
      S Offline
      SledgeHammer01
      wrote on last edited by
      #2

      Is this a WPF app? WPF uses URIs everywhere. But anyways, somewhere you are specifying a URI in the wrong format. Or the control is. Did you try turn on all first chance exceptions? That might help you catch it when its really happening.

      A 1 Reply Last reply
      0
      • S SledgeHammer01

        Is this a WPF app? WPF uses URIs everywhere. But anyways, somewhere you are specifying a URI in the wrong format. Or the control is. Did you try turn on all first chance exceptions? That might help you catch it when its really happening.

        A Offline
        A Offline
        Alan Balkany
        wrote on last edited by
        #3

        Thanks for the reply. It turns out it was getting into an unexpected part of the code after the Invoke (), so I have to dig deeper.

        L 1 Reply Last reply
        0
        • A Alan Balkany

          Thanks for the reply. It turns out it was getting into an unexpected part of the code after the Invoke (), so I have to dig deeper.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          when you want to close the thread, rather than remove the question and leave a messy thread, I would suggest you just append "[solved]" or "[closed]" to its subject line. TIA.

          Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

          A 1 Reply Last reply
          0
          • L Luc Pattyn

            when you want to close the thread, rather than remove the question and leave a messy thread, I would suggest you just append "[solved]" or "[closed]" to its subject line. TIA.

            Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

            Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

            A Offline
            A Offline
            Alan Balkany
            wrote on last edited by
            #5

            Noted.

            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