| ||||||||||||||
对该文的评论 | 人气:1003 |
clearcase/" target="_blank" >cccccc colSpan=3> lejin(2003-7-5 10:38:14) | ||
调试组件最好在xp里,这样免去重新注册的问题 |
nittystone(2003-7-4 23:58:23) | ||
其实,最好是先在VB环境下写个简单的测试程序,调整DLL准确无误时再用ASP使用。这样就算再出错,也不会麻烦几次的。 完全同意!!!! |
FamelStudio(2003-7-4 23:23:30) | ||
<script>´" |
mmmyyy12(2003-7-4 14:43:55) | ||
互联网下实现 打印, 报表, 图形分析的完美解决方案. 源码100%开放, 详情参见 http://www.fcSoft.com.cn |
c7654321(2003-7-4 11:27:37) | ||
其实,最好是先在VB环境下写个简单的测试程序,调整DLL准确无误时再用ASP使用。这样就算再出错,也不会麻烦几次的。 |
FamelStudio(2003-7-3 21:59:29) | ||
1)如果你想单步调试你的VB DLL,按照下面文章中写的:在IIS中设置你的WEB APP的属性,使其允许DEBUG;编译你的VB工程,按F5使VB IDE处于调试状态;访问创建该组件的ASP页面。 2)如果你仅仅想从内存中卸载该DLL(例如你想重新编译),有两个办法: A:打开COM+ Service Manager,在COM+ Applications中找到“IIS Out-Of-Process Pooled Applications”,在上面按右键,选择“Shut down”。原理是默认状态下IIS将WEB APP的Application Protection设置为“Medium (pooled)”,所有pooled app运行在同一个进程中(dllhost.exe)。如果你将你的WEB APP的Application Protection设置为low或者high,相应的你需要关闭“IIS In-Process Applications”或者其他Application。 B:打开COM+ Service Manager,创建一个新的空Application,从资源管理器中将你的DLL拖拽到该Application的Components中。这样的话你的DLL会被创建在该Application的进程中。需要卸载DLL时关闭该Application即可(按右键,选择“Shut down”)。 推荐方法B,因为方法B不会影响你的IIS应用,编译完后在浏览器中按刷新即可,所有的IIS Session都保持不变。 |
FamelStudio(2003-7-3 21:31:40) | ||
HOWTO: Debug a Visual Basic DLL from Visual InterDev -------------------------------------------------------- This article was previously published under Q200998 SUMMARY This article demonstrates how to debug a Visual Basic ActiveX dynamic-link library (DLL) using Visual InterDev 6.0 or later. MORE INFORMATION The Component Object Model (COM) DLL needs to be registered on the computer that is creating the object (through Server.CreateObject). Step-by-Step Example Start Visual Basic on the computer where Visual InterDev will be used for debugging, and create a new ActiveX DLL. Change the name of the project to MyVBComponent. Change the name of the Class module to CMyClass. Add the following code to the DLL: Public Function DebugTest (vntNum1 as Variant, vntNum2 as Variant) as Variant DebugTest = vntNum1 + vntNum2 End Function From the File menu, click Make MyVBComponent.dll. Set a breakpoint on the "DebugTest = vntNum1 + vntNum2" line in the DLL. From the Run menu, click Start (or press the F5 key) to run the program. Start Visual InterDev, and add a new Active Server Pages (ASP) page to the project. Add the following code to the new ASP page: <% Dim objMyComponent, vntNum1, vntNum2, vntResult vntNum1 = 1 vntNum2 = 2 Set objMyComponent = Server.CreateObject("MyVBComponent.CMyClass") vntResult = objMyComponent.DebugTest(vntNum1, vntNum2) Response.Write(vntResult) %> Place a breakpoint within the ASP page on the line that calls the DebugTest method. In the Project Explorer window of Visual InterDev, right-click this ASP page, and then click Set As Start Page. From the Debug menu, click Start (or press F5) to run the program. NOTE: If your project is not already configured within Microsoft Internet Information Server (IIS) for debugging, Visual InterDev prompts you to set this up. Click Yes in all of the dialog boxes that Visual InterDev presents, and Visual InterDev configures this automatically. Also note that the function keys that are used for debugging are different in Visual InterDev and Visual Basic. If the DLL is already loaded, you must restart IIS before you can debug the DLL, or you cannot stop on breakpoints. To restart IIS 4.0, type the following commands at a command prompt: Net Stop IISAdmin /y MTXSTOP Net Start W3SVC To restart IIS 5.0, type the following command at a command prompt: iisreset REFERENCES For additional information%1, click the article numbers below to view the articles in the Microsoft Knowledge Base: 198432 PRB: Server Object Error ´ASP 0178´ Instantiating COM Object 259725 PRB: Error When You Debug COM+ in the VB IDE with ASP Client 244272 INFO: Visual InterDev 6.0 Debugging Resources |
smuzy(2003-7-3 16:03:03) | ||
neu_leaf: 我也意识到这个问题,重复的编译后,注册表中有好多冗余的注册项。但是我使用的时候到现在为止还没有因为这个出现过问题。我在自己做开发的机子上就这么用了,感觉非常方便。不知道会不会什么时候突然出现故障。 你能不能详细的解释一下,如何把他注册到组建服务中,里面的有些选项我不是很清楚。 至于iisreset则运行起来太慢了,我忍受不了。赫赫 |
neu_leaf(2003-7-3 15:10:59) | ||
像你这样的编译,会导致注册表错乱! 建议,对于一个组件服务器,即dll,在机器上面只保留一个注册,(可以采用版本支持,或者在重建一个之前把以前的删掉)! 如果你觉得重新编译很麻烦的话,我建议:如果是在win2000下的话,可以把dll注册到组件服务中,要重新编译时只需停以下即可,很快,很简单;如果在无法使用组件服务的情况下,那就只用重起iis服务了。 |
hnliuwx(2003-7-3 13:03:04) | ||
运行iisreset,然后重新编译dll,就可以覆盖了。 |