- UID
- 1
- 积分
- 15892
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
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
---------------------------------------------------------------------- |
|