找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1300|回复: 0

ActiveX/VBA Technical Newsletter - November 1999

[复制链接]

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-1-7 01:57:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
ActiveX/VBA Technical Newsletter - November 1999  
This document is part of    AutoCAD VB(A) Newsletter Archive     



/Note: the URLs in this posting may be broken into several lines by the
transmission media. Please make sure that you have the full URL before
trying to access it./

/Note: Have you missed a Newsletter issue? Visit our Newsletter archive at
the following URL:/

http://adn.autodesk.com/techsupp/docs/newsletters.htm
  

Dear AutoCAD ActiveX/VBA Developer,

Table of Contents
=================
(1) Problem with SendCommand() in VBA macros
(2) AutoCAD Slide ActiveX control problem
(3) New or Updated Solutions
  

(1) Problem with SendCommand() in VBA macros
============================================

The AcadDocument::SendCommand() method is documented to run synchronously if
no user interaction is required with the issued command. However, it runs
synchronously if the VBA macro is executed from the VBA editor, or if the
SendCommand() method is called from an out-process server, but runs
asynchronously if the method is called from the AutoCAD interface.

The AcadDocument::SendCommand() is documented in the AutoCAD shipping release
to run synchronously if no user interaction is required with the issued
command. It means that the command and arguments passed as parameter to that
method is supposed to be executed immediately. However, because of a defect
in the interface, this method runs asynchronously in VBA.

Consider this piece of code:

ThisDrawing.Sendcommand ("_line 0,0 1,1 " & vbCr)
MsgBox (ThisDrawing.ModelSpace.Count)

The above code will behave differently if run from a VB out-process client,
or a VBA macro. The VB code will execute the command synchronously
(immediately), whereas the VBA macro will execute the command
asynchronously (later, when AutoCAD will be in quiescent state).

the result of running that above code in VB on a empty drawing will be "1"
whereas VBA will be "0", because the 'line' command is executed after the
VBA macro has been completed.

The attached ZIP file (see URL's below) contains a utility written by the
Developer Consulting Group, which defines two new commands "VBARUNEX" and
"-VBARUNEX". These commands are functionally equivalent to "VBARUN" and
"-VBARUN" respectively but the SendCommand method behaves properly when
the macro is executed with the "ex" versions. The ARX utility is demand
loaded at startup and is self registering capable, so you need to load it
only once on your system to have access to the extra command later
(Source code of the utility is available in <Solution 34815>).

This utility solves the problem of synchronization of the SendCommand()
method in AutoCAD r2000 build T098. However, since this defect is fixed in
later builds, you should keep in mind the following compatibility issues:

1 - VBA macro which wants to execute call to SendCommand() asynchronously
     may defer the call to SendCommand() until the end of VBA macro as the
  last statement(s) before the macro completes. This will still make
  asynchronous call to SendCommand() in R2000, and will emulate the
  asynchronous call in later builds where the defect is fixed...

2 - VBA macro developed on later builds may not work properly in R2000,
     if the customer does not use the above utility.

3 - This problem only exists in AutoCAD build T098. You can check the build
     number of your AutoCAD by typing _vernum on the command line.
  If _vernum reports a number greater then 98 then you don't need to use
  this utility.
  

SENDCOMMAND METHOD RUNS ASYNCHRONOUSLY IF CALLED IN VBA MACRO
/cgi-bin/solution.pl?SID=29983

SENDCOMMAND METHOD RUNS ASYNCHRONOUSLY IF CALLED IN VBA MACRO (SRC CODE)
/cgi-bin/solution.pl?SID=34815
  
  

(2) AutoCAD Slide ActiveX control problem
=========================================

Last week a developer reported a problem while using the DevCon Slide ActiveX
control in an MFC application. The problem was showing up when his C++/MFC
application, developed with the DevCon Slide.ocx version 2.0.0.3, was running
on a system where version 3.0.0.4 was installed. This turned into a problem
for his MFC application which was not able to execute anymore.
This problem is due to a problem in the MFC implementation which does affect
MFC applications only. It does not cause any problem to VB/VBA/C++/Delphi
applications at all. But we do encourage you to ship from now on the DevCon
Slide.ocx control version 4.5.0.0 which is available on the ADN WEB site at:

http://adn.autodesk.com/techsupp/utilitiescontrols.htm

This version make sure to fix the problem for all applications, and
guarantees backward compatibility with MFC applications developed on older
version of the control (any version). Using this version does not require
you to update your source code, or to recompile your application. You just
need to register the new version of the control on the target system.

(3) New or updated Solutions
============================

ACADUNSUPP.ARX BINARIES
/cgi-bin/solution.pl?SID=17052

ACADUNSUPP SOURCE
/cgi-bin/solution.pl?SID=17053

WHERE ARE PLOTSTYLENAMES STORED AND HOW TO GET THEM
/cgi-bin/solution.pl?SID=45191

SET THE PAPER SIZE OF A LAYOUT
/cgi-bin/solution.pl?SID=45278

ADD ENTITIES INTO LAYOUT2
/cgi-bin/solution.pl?SID=45318

CLOSE ACAD WINDOW WHEN IT IS IN THE ZERO DOC STATE
/cgi-bin/solution.pl?SID=45363

OPEN AN EXISTING OR CREATE NEW DWG IN ZERO DOC STATE
/cgi-bin/solution.pl?SID=45366
  

-----------------------------------------------------------------------------
To subscribe or unsubscribe, go to
http://adn.autodesk.com/techsupp/docs/newsletters.htm
-----------------------------------------------------------------------------

     You received this message as a result of your registration
     on the ADN List Server subscription page.  If you no longer wish
     to receive these messages, read the next section, How to use this
     mailing list.

     How to use this mailing list:

     You may unsubscribe from this e-mail newsletter, or subscribe to
     a variety of other informative e-mail newsletters, by returning
     to the ADN List Server subscription page at
       http://adn.autodesk.com/techsupp/docs/newsletters.htm
     and changing your subscription preferences.

     Alternatively, from the subscribed account you can send an e-mail to
     <Majordomo-partnersys@autodesk.com> with the following command in the
     body of your email message:

     unsubscribe <list-name>

     ----------------------------------------------------------------------

     Autodesk Developer Network (ADN) information and events:

     For information on all ADN topics, please visit:
       http://www.autodesk.com/adn

     ----------------------------------------------------------------------

     THIS DOCUMENT IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY.  The
     information contained in this document represents the current view of
     Autodesk Inc. on the issues discussed as of the date of publication.
     Because Autodesk must respond to change in market conditions, it
     should not be interpreted to be a commitment on the part of Autodesk
     and Autodesk cannot guarantee the accuracy of any information
     presented after the date of publication.
     INFORMATION PROVIDED IN THIS DOCUMENT IS PROVIDED 'AS IS' WITHOUT
     WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
     LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
     PARTICULAR PURPOSE AND FREEDOM FROM INFRINGEMENT.
     The user assumes the entire risk as to the accuracy and the use of
     this document. This  document may be copied and distributed subject to
     the following conditions:
     1.   All text must be copied without modification and all pages must
          be included
     2.   All copies must contain Autodesk's copyright notice and any other
          notices provided therein
     3.   This document may not be distributed for profit

     ----------------------------------------------------------------------
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-12-5 02:59 , Processed in 0.447171 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表