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