Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening (Multiple) AUTOCAD Files from VFP
Message
From
03/11/2003 06:21:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00845380
Message ID:
00845542
Views:
12
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform