OLE Clean-Up Utility TechNote

Support

<< Return to Index
Subject: OLE Clean-Up Utility
Product: MicroStation/J
Operating System: Windows® 2000, Windows NT® 4.0, Windows 98, Windows 95
Document Number: 8218

If you receive an "hresult" error when opening a design file you can download the cleanole.zip file (128kb) from Bentley FTP site and follow the instructions below:

Cause:  When a DGN file is started, a type 66 element is created that is reserved for an outside application (Excel) to write data into the design file.  An “.ole” file with the same name as the DGN file is created in the MicroStation “temp” folder.  The ole file will remain in the temp folder until the DGN is closed. The ole temporary is created each subsequent time the DGN file is opened.

 

In the case where the “hresult” error occurs, the type 66 element has not been written correctly in the DGN file.  When exiting the DGN, the .ole file remains in the temporary folder. When this or any other DGN file is opened the “hresult” message occurs.  In some cases, what may appear as corruption in other files is often times in just one or more files because the .ole file is present in the “temp” folder.  To resolve the problem, the “type 66” element must be removed and any .ole file must be removed from the temporary folder. This is the purpose of the cleanole utility.

Note: If you receive an access violation error when extracting the cleanole.zip files, uncheck "Use Folder Names" in the Extract dialog box of WinZip®.

Warning: Using this utility will disconnect all information related to OLE within the current design file.

  1. Copy cleanole.ma into your \MicroStation\mdlapps directory.
  2. Copy olefix.cfg into your \MicroStation\config\appl directory.
  3. In the MicroStation\mdlsys\asneeded folder, back up the original olecntr.dll and olecntr.ma files. Then copy the olecntr.dll and olecntr.ma files from the cleanole.zip to replace the original files.*

    * - Skip this step if you are running the cleanole mdl application in MicroStation/J version 07.01.xx.xx. or later.

  4. In the \MicroStation\config folder, use an ASCII text editor (such as Notepad) to modify mslocal.cfg.*
     
    ADD THE FOLLOWING TO MSLOCAL.CFG 
    %include $(MSDIR)config\appl\olefix.cfg
    
    * - Skip this step if you are running the cleanole mdl application in MicroStation/J version 07.01.xx.xx. or later.

    Whenever you encounter an "hresult" error upon opening a design file, choose Utilities > CleanOle. The design file will be cleaned and you will be prompted to exit MicroStation. Reopen the design file and the error message should not appear. If the hresult errors are still present, Navigate to the \Bentley\Program\MicroStation\Temp folder, with MicroStation closed, remove all ".ole" files. These files are temporary files that are stored in the temp folder necessary for data to be written to the design file through OLE. These files should not be in this folder when MicroStation is closed, therefore they must be deleted.

  5. Users can also clean multiple files in the same directory by running cleanole with MSBATCH. This will need to be run from the command prompt of DOS from the \Bentley\Program\MicroStation\ directory. The syntax the user will need to type in is:

    MSBATCH cleanole directory d:\data\problems\olecntr\ (trailing separator needed) extension dgn verbose true recurse true

    This would recurse through all the directories under the olecntr directory and only work on pid files and print some debugging type messages to the screen.

    Msbatch cleanole operationmod=value where operationmod can be:

    directory= A directory name, default is the current working directory.

    filename= A file, if you only want to process one file. No extension if used with the extension mod.

    extension= File extension to use, for example dgn and s01, the default is *.* .

    verbose= TRUE or FALSE to print some extra messages

    recurse= TRUE or FALSE to control recursion through sub directories of the folder that you specify.

8218

How useful was this page?
less   more
Suggest new content or let us know how we can improve this content (optional):

<< E-mail this page