几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-12, 09:29 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】install a .net dll add-in again

install a .net dll add-in again
here is the quote from solidworks website
"how to install a .net dll add-in
with .net add-ins, you can copy the bin directory to a suitable location on the target machine."
i copies the bin directory to a user's computer and here is the msg when the user tried to run the addin
"unable to initilize the add-in component"
chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
your addin does not have the required initialization/connect/disconnect functions required by an addin i would have thought. check your dll class.
luke,
i used the template from solidworks and only added more code to the template
as i said, it works fine if i manually install the addin to the solidworks; however, if i tried to put the addin to the server, then i had trouble to install it
chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
you cannot load addins off servers due to security permissions in .net i'm pretty sure. you may be able to resolve this by changing .net security permissions using the .net security management tool
you will be required to register u r .dll in gac(global assembly cache) in order to used it in users machine or other than development machine.
below mentioned is the procedure to register........
hope it ll help u.................
registering your microsoft.net add-in ensures that it is known to both the com run-time and the solidworks software. if you build your microsoft.net add-in on a development machine, then the registration is performed for you as part of the build process. during registration, the code in the function marked with the comregisterfunction attribute is executed.
to register your add-in on a machine other than the machine that you built it on, use regasm.exe at the command prompt on that machine:
> c:\windows\microsoft.net\framework\v2.0.50727\regasm.exe .dll /codebase
note: the effect of the /codebase command line argument is that the entries in the registry (hkey_classes_root\clsid) have a codebase value containing the location of the dll. this allows the microsoft .net framework (i.e., mscoree.dll) to locate the dll that implements the com object that the solidworks software tries to create when loading your add-in.
for this to work, make sure that the interop assemblies on which your add-in depends are available on the target machine because both regasm.exe and the microsoft .net run-time need them.
if you created the interop assemblies in microsoft visual studio (interop.sldworks.dll, interop.swconst.dll, interop.swpublished.dll, etc.), then make sure that the interop assemblies are copied with your add-in's dll.
if you are using the solidworks-supplied primary interop assemblies (pias) shipped with the solidworks software (e.g., solidworks.interop.sldworks.dll, solidworks.interop.swpublished.dll, solidworks.interop.swpublished.dll, etc., which reside in the solidworks installation folder where sldworks.exe also resides), then you can either copy these pias with your add-in or ensure that they are available from the global assembly cache (gac) on the target machine.
using regasm.exe will issue a warning like the following because the add-in's dll is not strongly named or signed (a microsoft .net feature).
regasm warning: registering an unsigned assembly with /codebase can cause
your assembly to interfere with other applications that may be installed on the
same computer. the /codebase switch is intended to be used only with signed
assemblies. please give your assembly a strong name and re-register it.
you can ignore this warning, as it applies to how .net searches for referenced assemblies. here we do not rely on the .net search order, as the /codebase option is required to explicitly tell com where to find the dll for an in-process server.
alternatively you can sign the add-in's assembly.
if your add-in needs to be registered on a 64-bit machine for use with solidworks x64, use the 64-bit version of regasm.exe:
> c:\windows\microsoft.net\framework64\v2.0.50727\regasm.exe .dll /codebase
this ensures the registration data for com and solidworks is added to the 64-bit of the registry.
to unregister your add-in, use regasm.exe with the /unregister option. this will execute the code in the function marked with the comregisterfunction attribute.
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】install a .net dll add-in again yang686526 SolidWorks二次开发 0 2009-04-12 06:44 PM
【转帖】dll学习(资料收集) huangyhg vc编程 0 2008-05-17 09:24 PM
最难清除木马 Dll木马揭秘 huangyhg vc编程 0 2007-04-12 07:31 PM
【转帖】对于hook函数的一点认识 huangyhg vc编程 0 2007-03-27 11:53 AM
regsvr32.exe的使用 cam 论坛管理 0 2007-02-27 11:07 PM


所有的时间均为北京时间。 现在的时间是 08:02 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多