﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Azusa</title><link>http://www.cppblog.com/Azusa/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 23 Apr 2026 10:14:34 GMT</lastBuildDate><pubDate>Thu, 23 Apr 2026 10:14:34 GMT</pubDate><ttl>60</ttl><item><title>VC++动态链接库(DLL)编程深入浅出(一)</title><link>http://www.cppblog.com/Azusa/archive/2007/10/07/33719.html</link><dc:creator>Azusa</dc:creator><author>Azusa</author><pubDate>Sun, 07 Oct 2007 14:11:00 GMT</pubDate><guid>http://www.cppblog.com/Azusa/archive/2007/10/07/33719.html</guid><wfw:comment>http://www.cppblog.com/Azusa/comments/33719.html</wfw:comment><comments>http://www.cppblog.com/Azusa/archive/2007/10/07/33719.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Azusa/comments/commentRss/33719.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Azusa/services/trackbacks/33719.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1.概论　　先来阐述一下DLL(Dynamic Linkable Library)的概念，你可以简单的把DLL看成一种仓库，它提供给你一些可以直接拿来用的变量、函数或类。在仓库的发展史上经历了&#8220;无库－静态链接库－动态链接库&#8221;的时代。[被屏蔽广告]　　静态链接库与动态链接库都是共享代码的方式，如果采用静态链接库，则无论你愿不愿意，lib中的指令都被直接包含在最终生成的EX...&nbsp;&nbsp;<a href='http://www.cppblog.com/Azusa/archive/2007/10/07/33719.html'>阅读全文</a><img src ="http://www.cppblog.com/Azusa/aggbug/33719.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Azusa/" target="_blank">Azusa</a> 2007-10-07 22:11 <a href="http://www.cppblog.com/Azusa/archive/2007/10/07/33719.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>网络服务</title><link>http://www.cppblog.com/Azusa/archive/2006/02/28/3561.html</link><dc:creator>Azusa</dc:creator><author>Azusa</author><pubDate>Tue, 28 Feb 2006 00:36:00 GMT</pubDate><guid>http://www.cppblog.com/Azusa/archive/2006/02/28/3561.html</guid><wfw:comment>http://www.cppblog.com/Azusa/comments/3561.html</wfw:comment><comments>http://www.cppblog.com/Azusa/archive/2006/02/28/3561.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Azusa/comments/commentRss/3561.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Azusa/services/trackbacks/3561.html</trackback:ping><description><![CDATA[打造网络服务，提供专业知识<img src ="http://www.cppblog.com/Azusa/aggbug/3561.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Azusa/" target="_blank">Azusa</a> 2006-02-28 08:36 <a href="http://www.cppblog.com/Azusa/archive/2006/02/28/3561.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>arx and dll problem</title><link>http://www.cppblog.com/Azusa/archive/2006/02/27/3550.html</link><dc:creator>Azusa</dc:creator><author>Azusa</author><pubDate>Mon, 27 Feb 2006 08:52:00 GMT</pubDate><guid>http://www.cppblog.com/Azusa/archive/2006/02/27/3550.html</guid><wfw:comment>http://www.cppblog.com/Azusa/comments/3550.html</wfw:comment><comments>http://www.cppblog.com/Azusa/archive/2006/02/27/3550.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Azusa/comments/commentRss/3550.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Azusa/services/trackbacks/3550.html</trackback:ping><description><![CDATA[--------------------------------------------------------------------------------<BR>Hello everybody,<BR><BR>Please consider this:<BR><BR>1. I have a few ARX's all using the same functions. So I put the common<BR>functioms in foo.dll and every ARX uses the dll.<BR><BR>2. Some of the functions in the dll use ObjectARX functions.<BR><BR>3. In acad2000 everything works OK (well, almost - a few ARX's<BR>developed a slightly erratic behaviour).<BR><BR>4. Now I try to migrate to acad2004 (using VS 2002). I built foo.dll<BR>and, as a test project, loo.arx. Everything is compiling OK,<BR>but arxloading loo.arx causes an unhandled exception.<BR><BR>Can anybody please give me a clue and/or references? It's obvious I<BR>miss or don't understand something.<BR><BR>Thank you,<BR><BR>alex<BR><BR>--------------------------------------------------------------------------------<BR>So as your dll links against ARX Modules, it depends on those modules to <BR>be loaded by the Rx System using the dynamic linker. Windows will load <BR>them for you if needed, however, it will not call the acrxentrypoint <BR>function, wich might lead to ARX Modules that are not connected to the <BR>RX system.<BR>As you allready depend on ARX, I would recommend to make your DLL an ARX <BR>DLL and load it by your other ARX modules that depend on it using the <BR>dynamic linker.<BR>--------------------------------------------------------------------------------<BR>The erratic behaviour might come from what I wrote above<BR><BR>Where does this exception occur? Have you debbugged it? BTW, you can set <BR>you debugger to break when an exception is thrown under <BR>Debug|Exceptions: Mark C++ Exception and Win32 Exceptions and select <BR>"Break into the ..." under "When Exception is thrown"<BR>As said, I would recommend to change your DLL into an ARX(DBX) DLL and <BR>load it from your other ARX modules using the dynamic linker. This will <BR>most likely eliminate your problems.<BR>HTH,<BR>Andy<BR>--------------------------------------------------------------------------------<BR>Do you mean building the dll as .DBX and explicitly loading it at<BR>acrxEntryPoint() in my ARX?<BR>The dll contains functions which have to be available for other ARX's as<BR>well, so I presume I have<BR>to make the acrxLoadModule() call in every ARX which uses those funcs, and<BR>that in addition<BR>to the implicit loading by the OS..<BR>It also implies (?) I have to link every ARX to this DBX.<BR><BR>--------------------------------------------------------------------------------<BR>I don't know enough about debugging and just moved to VS2002. I heard about<BR>problems debugging under acad2004.<BR>Could you elaborate?<BR>(I could post the Autocad message window with the exception.)<BR><BR>Thank you,<BR>alex<BR><BR>--------------------------------------------------------------------------------<BR>yes. And in you "converted" DLL, call acrxLoadModule() for each other <BR>ARX this DLL depends on. This will ensure that everything is initialized <BR>correctly. (Don't forget to unload them in you unload sequence :-) )<BR><BR>--------------------------------------------------------------------------------<BR>yes. <BR><BR>As I understood the OP, your DLL is allrady using ARX stuff. This means <BR>that it allready links to ARX modules and can't be used outside an <BR>DBX/ARX context. Additionally your other ARX must allready link against <BR>yor DLL. So actually the linking stays as it was and you loose nothing<BR><BR>--------------------------------------------------------------------------------<BR>To make it short: There are issues with debbugging. There is an Addin in <BR>your SDK, that should solve this, howver, it does not seem to work for <BR>some people. Just try it out. Hit F5, enter the path to acad.exe. If it <BR>works, be happy :-). If it doesnot, do the following:<BR>-Uninstall the addIn<BR>-Start Acad manually<BR>-In VS, go Debug|Processes..<BR>-In the "Available Processes" list, choose acad.exe And hit "Attach"<BR>-Hit "Close"<BR>-put a breakpoint in your acrx entrypoint function using F9<BR>-goto acad, load your arx. It should jump into te debugger<BR>-use F10 to step through, F11 to step into a function.<BR>-At some point the exception will fly. If this is one of your functions, <BR>investigate it by stepping into it, if it is ARX stuff, look at the <BR>documentation and/or come back here with this specific code snippet. We <BR>are happy to help :-)<BR><BR>Sometimes it takes a while for te debugger to break in the first time <BR>and the system seems to hang. Just wait a bit....<BR>--------------------------------------------------------------------------------<BR>The .dbx extension is typically used when you are defining a custom <BR>entity and it does not link with AutoCAD (acad.exe or any of the dll's <BR>in the same folder). If that's not the case, the arx extension is more <BR>appropriate and perfectly acceptable.<BR><BR>Also I find it easier to keep track of linkages by including a #pragma <BR>for the link in the main .cpp file rather than as a linker setting. <BR>This way the call to acrxLoadModule and the #pragma are in the same <BR>file. If anything changes I don't have to go several different places.<BR><BR>If you have several arx's and/or dbx's that have specific dependencies <BR>it may be easier to just create a loader arx that loads the all others <BR>(via acrxLoadModule) in the appropriate order. This way the user or <BR>installer only needs to load the one arx...<BR><BR>-- <BR>Best regards,<BR><BR>Byron Blattel<BR><BR>--------------------------------------------------------------------------------<BR><BR>--------------------------------------------------------------------------------<BR><BR>--------------------------------------------------------------------------------<BR><BR>--------------------------------------------------------------------------------<BR><BR>--------------------------------------------------------------------------------<BR><BR>--------------------------------------------------------------------------------<BR><BR>--------------------------------------------------------------------------------<img src ="http://www.cppblog.com/Azusa/aggbug/3550.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Azusa/" target="_blank">Azusa</a> 2006-02-27 16:52 <a href="http://www.cppblog.com/Azusa/archive/2006/02/27/3550.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>多个ARX间的函数的调用</title><link>http://www.cppblog.com/Azusa/archive/2006/02/27/3549.html</link><dc:creator>Azusa</dc:creator><author>Azusa</author><pubDate>Mon, 27 Feb 2006 08:43:00 GMT</pubDate><guid>http://www.cppblog.com/Azusa/archive/2006/02/27/3549.html</guid><wfw:comment>http://www.cppblog.com/Azusa/comments/3549.html</wfw:comment><comments>http://www.cppblog.com/Azusa/archive/2006/02/27/3549.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/Azusa/comments/commentRss/3549.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Azusa/services/trackbacks/3549.html</trackback:ping><description><![CDATA[从DLL的角度，把一个ARX当作一个DLL文件来调用，同样可以调用已经定义的函数，详见附件例程<BR>（附件有两个工程，第一个定义了可以输出的外部函数，第二个调用了第一个工程生成的ARX里的函数）<BR><BR>但这个方法只是生硬的调用了函数，没有实现不同ARX间的“通讯”。还有就是怎么调用已定义的类，还没学会，谁有经验，可否借鉴。<BR><BR>当然我们可以用COM，不过代码量很大。<BR><BR>更好的办法是做一个公共的类，在每个工程存在，各个工程通过公共类的虚函数访问！<BR><BR>如果用COM还不如就用acedRegFunc()登记命令讲究吧（虽然它本质上是ADS的处理方法）<BR>不过我很奇怪，ACAD加入加载了ARX到内存了，就没办法把它共享给其他ARX吗？<img src ="http://www.cppblog.com/Azusa/aggbug/3549.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Azusa/" target="_blank">Azusa</a> 2006-02-27 16:43 <a href="http://www.cppblog.com/Azusa/archive/2006/02/27/3549.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>net wrapped managed code</title><link>http://www.cppblog.com/Azusa/archive/2006/02/27/3546.html</link><dc:creator>Azusa</dc:creator><author>Azusa</author><pubDate>Mon, 27 Feb 2006 06:37:00 GMT</pubDate><guid>http://www.cppblog.com/Azusa/archive/2006/02/27/3546.html</guid><wfw:comment>http://www.cppblog.com/Azusa/comments/3546.html</wfw:comment><comments>http://www.cppblog.com/Azusa/archive/2006/02/27/3546.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Azusa/comments/commentRss/3546.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Azusa/services/trackbacks/3546.html</trackback:ping><description><![CDATA[<P>.net wrapped managed code, 是将来的发展方向。应该给以注意。</P><img src ="http://www.cppblog.com/Azusa/aggbug/3546.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Azusa/" target="_blank">Azusa</a> 2006-02-27 14:37 <a href="http://www.cppblog.com/Azusa/archive/2006/02/27/3546.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>