简体   繁体   English

axapta中的activeX组件

[英]activeX component in axapta

i'm struggling with an .net activeX i try to use in ms axapta 2009. 我正在努力尝试在ms axapta 2009中使用.net activeX。

using this component on my local machine where it was compiled, it's working quite fine. 在我的本地计算机上使用该组件进行编译,就可以正常工作。 it can be added as activeX element on a form, the methods and events are listed in the axapta-activeX-explorer and i can interact with it without any problems. 它可以作为activeX元素添加到表单上,方法和事件在axapta-activeX-explorer中列出,我可以毫无问题地与它进行交互。

but trying to distribute the dll to other clients isn't working as intended. 但是尝试将dll分发给其他客户端无法正常工作。 the registration of the dll via regasm /codebase /tlb works properly - getting the message, registration was successful. 通过regasm / codebase / tlb进行dll的注册可以正常工作-收到消息后,注册成功。 the component is also listed when selecting an activeX-element to add in ax, but neither functions nor properties are listed. 选择要添加到ax中的activeX元素时,也会列出该组件,但未列出函数或属性。 and launching the form results in an errormessage - activeX component CLSID ... not found on system, not installed. 并启动表单会导致错误消息-activeX组件CLSID ...在系统上未找到,未安装。 the classID is indeed the one, defined in .net. classID确实是.net中定义的那个。

strange things happen, having a look on the task-manager. 看看任务管理器,会发生奇怪的事情。 the activeX-component itself is just a wrapper to interact with a com-application. activeX组件本身只是一个与com应用程序交互的包装器。 when launching the ax-form with the not working and _not_installed_!! 当启动不工作和_not_installed_的斧头形式时! activeX-thing, the taskmanager shows a new process of the com-application, which is instanciated by the activeX :/ activeX-thing,任务管理器显示了com-application的新进程,由activeX实例化:

things i tried: 我尝试过的事情:

  • using different versions of regasm, eg \\Windows\\Microsoft.NET\\Framework\\v2.0.50727 ; 使用不同版本的regasm,例如\\ Windows \\ Microsoft.NET \\ Framework \\ v2.0.50727; C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727 C:\\ WINDOWS \\ Microsoft.NET \\ Framework64 \\ V2.0.50727
  • using new GUIDs in .net, prior removing the old ones from the registry 在.net中使用新的GUID,然后从注册表中删除旧的GUID
  • compiling, using different versions of the .net framework 使用.net框架的不同版本进行编译
  • doing registration via regasm, regasm /codebase, regasm /codebase /tlb, using a visual-studio-setup 使用visual-studio-setup通过regasm,regasm / codebase,regasm / codebase / tlb进行注册
  • running registration via command-line as administrator 通过命令行以管理员身份运行注册
  • running setup as administrator 以管理员身份运行安装程序
  • running even ax as administrator on client-machine 在客户端计算机上以管理员身份甚至运行ax
  • moving dll to a different folder followed by new registration ( windows/system32; ax/client/bin ) 将dll移至其他文件夹,然后进行新注册(Windows / system32; ax / client / bin)
  • installing to GAC ( gacutil /i ) 安装到GAC(gacutil / i)
  • different project-options in visual studio ( COM-Visibility; register for COM-Interop; different targetPlatform ) Visual Studio中的不同项目选项(COM-Visibility;注册COM-Interop;不同的targetPlatform)

hoped for the fact, that compiling in visual studio with register for COM-Interop option enabled does something more than just the regasm-registration, i used a registry-monitor-microsoft-tool for logging the registry-activity which happend during compilation. 希望事实是,在启用了COM-Interop注册的情况下在Visual Studio中进行编译不仅可以实现重新注册,还可以做更多的事情,我使用了Registry-Monitor-Microsoft-Tool工具来记录在编译过程中发生的注册表活动。

using these logs to create all registry-entries on the target-client in addition didn't work either. 另外,使用这些日志在目标客户端上创建所有注册表项也不起作用。

any hints or help would be so much appreciated! 任何提示或帮助将不胜感激! this thing is blocking me for days now :( 这东西现在已经把我堵了好几天了:(

For an overview of COM integration look here: 有关COM集成的概述,请单击此处:

http://msdn.microsoft.com/en-us/library/aa591337.aspx http://msdn.microsoft.com/en-us/library/aa591337.aspx

For an overview of .Net integration look here: 有关.Net集成的概述,请单击此处:

http://msdn.microsoft.com/en-us/library/aa659581.aspx http://msdn.microsoft.com/en-us/library/aa659581.aspx

the "target"-application, with which i want to interact is a stand-alone exe with COM-functionality. 我要与之交互的“目标”应用程序是具有COM功能的独立exe。 as i know, COM isn't ( or will not be ) supported in AX 2009 - therefore .net should be used. 据我所知,AX 2009不(或将不)支持COM-因此应使用.net。 if i understand your answer correctly, it's just the other one round! 如果我正确理解您的答案,那只是另一轮! the dll just works as a wrapper to access the application mentioned above. dll只是作为包装程序来访问上述应用程序。 regsvr32 don't work with the dll, since regasm must be used to register. regsvr32不适用于dll,因为必须使用regasm进行注册。 i've also added a reference in the AOT - no change. 我还在AOT中添加了参考-不变。 curious thing is - it has already worked, and is still working on my local dev system. 奇怪的是-它已经起作用,并且仍在我的本地开发系统上起作用。 but not on other systems. 但不在其他系统上。

problem solved. 问题解决了。 everything was correct - only misleading thing was the error-message launching a form with the activeX-component added, telling "component not found on system..." 一切都是正确的-唯一令人误解的是错误消息启动了添加了activeX-component的表单,并告诉“系统上未找到组件...”

it was a totally different error in the activeX code: parsing a xml-document with a special character in it and without defining the correct iso-encoding in the xml-file had thrown an error not catched. 这是ActiveX代码中完全不同的错误:解析其中带有特殊字符的xml文档,而未在xml文件中定义正确的iso编码,则会引发未捕获的错误。 this(!!) caused all further problems and the crash-bug mentioned in the initial post :/ this(!!)导致了所有其他问题,并且在最初的帖子中提到了崩溃错误:/

thanks anyway for help. 无论如何,谢谢您的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM