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. how can i get exception from virtual machine

how can i get exception from virtual machine

Scheduled Pinned Locked Moved C#
questionjson
3 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.
  • B Offline
    B Offline
    belea17
    wrote on last edited by
    #1

    I want to get an exception when I am running a program on virtual machine. I use VIX API and RunProgramInGuest... try { vmx.RunProgramInGuest(@"C:\Windows\system32\My Program.exe", "", true, false, false); } catch {....?} Thank you

    D P 2 Replies Last reply
    0
    • B belea17

      I want to get an exception when I am running a program on virtual machine. I use VIX API and RunProgramInGuest... try { vmx.RunProgramInGuest(@"C:\Windows\system32\My Program.exe", "", true, false, false); } catch {....?} Thank you

      D Offline
      D Offline
      Deflinek
      wrote on last edited by
      #2

      I'm not sure you can just catch exception from another process just like that if MyProgram.exe isn't aware of what you want to do. To be honest, this scenario isn't much different on catching exception from another process on other physical machine or even on the same machine. If you have control over MyProgram.exe you can write its default error handler to notify your main application on any exception. For hints look there http://lmgtfy.com/?q=inter+process+communication[^] and especially on http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx[^] Hope this helps.

      -- "My software never has bugs. It just develops random features."

      1 Reply Last reply
      0
      • B belea17

        I want to get an exception when I am running a program on virtual machine. I use VIX API and RunProgramInGuest... try { vmx.RunProgramInGuest(@"C:\Windows\system32\My Program.exe", "", true, false, false); } catch {....?} Thank you

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        You may want to read this[^] article. Pay particular attention to the section "Transforming Error Codes into Exceptions".

        *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

        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