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. Visual Basic
  4. running a winapp with parameters from AutoCad

running a winapp with parameters from AutoCad

Scheduled Pinned Locked Moved Visual Basic
helpquestion
2 Posts 2 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.
  • M Offline
    M Offline
    MacIntyre
    wrote on last edited by
    #1

    I have written a WinApp that can be launched from AutoCad. If I run it with no parameters it works just fine displaying the dialog box. (path\test.exe) If I add a parameter for a lookup table the launching app gets a hyperlink not found error. (path\test.exe 1234) If I place a # in the path (path\test.exe#1234) the app runs but can not find the parameter 1234. Is there something I need to add to my code to recognize the 1234 in the args string in the my WinApp? Thanks...

    L 1 Reply Last reply
    0
    • M MacIntyre

      I have written a WinApp that can be launched from AutoCad. If I run it with no parameters it works just fine displaying the dialog box. (path\test.exe) If I add a parameter for a lookup table the launching app gets a hyperlink not found error. (path\test.exe 1234) If I place a # in the path (path\test.exe#1234) the app runs but can not find the parameter 1234. Is there something I need to add to my code to recognize the 1234 in the args string in the my WinApp? Thanks...

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

      MacIntyre wrote:

      Is there something I need to add to my code to recognize the 1234 in the args string in the my WinApp?

      I don't have AutoCAD, so I can't verify my claims here.

      path\test.exe 1234

      That one doesn't seem to exist, as you stated, it tries to locate the file "text.exe 1234", which indeed doesn't exist. You could try to put the filename in quotes, like this;

      "path\test.exe" 1234

      That should be enough to make a distinction between the file (allowing AutoCAD to test for it's existence) and the parameter. It's not guaranteed to work; some programmers take the entire input-string and assume that it's a file that must exist.

      MacIntyre wrote:

      f I place a # in the path (path\test.exe#1234) the app runs but can not find the parameter 1234.

      There the target exists, but I guess that "#1234" has become part of the filename and no longer counts as a parameter. You could check whether args[0] contains both the filename and the parameter - if it does then you could perhaps work around the limitation by splitting the filename on the "#"-character. Good luck :)

      I are Troll :suss:

      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