>Hi All,
>
>I'm attempting to write an application which will open Autocad Files (I'm running AUTOCAD 2002 LT) from VFP8. I'm able to consistently open a file when Autocad is not running using both WSH & SHELLEXECUTE.
>
>However, if AUTOCAD (2002 LT) is currently running, I am not able to get consistent results. The Foxpro app 'hangs' and ALT-TABBING over to Autocad displays a shrunken version of the File. It appears that AutoCad behaves differently from other apps such as Acrobat, Excel, etc. where you can open multiple files using WSH or SHELLEXECUTE. I know the full version of AUTOCAD supports automation, but at present the client only has the LT Version.
>
>Has anyone else run into this issue?
I don't suggest and use WSH (ie: WSH might be disabled due to security).
As per ShellExecute it's not related with VFP. It simply calls the winAPI. It's like dblclicking the app (or associated file like doc, dwg in explorer).
If nothing is associated with .dwg and you use only the dwg filename in executable parameter winXP put up the open with list and that might make you mistakenly think VFP hung. In fact Shellexecute didn't return yet. To fix that pass the full exe and dwg filename. ie:
ShellExecute(0,0,'c:\MyPath\autocad.exe','c:\myPath\myFile.dwg',0,1)
Cetin