DWG TrueView

DWG TrueView

Active Contributor
Posts: 36
Registered: ‎02-17-2010
Message 1 of 1 (216 Views)

Viewing a drawing using ShellExecute

216 Views, 0 Replies
09-11-2013 10:25 AM

We have a drawing control program that allows a user to view a drawing file using the program associated with the DWG extension on the PC.  In this case the program associated with the DWG extension is DWG TrueView 2014.  To lauch the program we use the ShellExecute function to execute the selected the drawing file which causes Windows to launch the program associated with DWG extension.  Here is the function call we use.


HINSTANCE hInst = ShellExecute(NULL, szOperation, szDocName, NULL, NULL, nShowCmd);



  Operation = "open"

  szDocName = drawing filename

  nShowCmd = SW_SHOW


Using ths function Windows launches the DWG TrueView 2014 program; however, DWG TrueView generates an error message indicating that is can't load the AcSceneOE.dbx file in the calling program's directory which is understandable because the drawing control program does not have the DWG TrueView files.


The ShellExecute function does provide a way to specified the default working directory but at the time the function is called we have not idea what that directory may be because we don't know what program is associated with the DWG extension.


Note: If AutoCAD is associated with DWG, we have no problems.


Is there anyway to get DWG TrueView to look for its files in its own directory instead of the currect working directroy?



Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.