axapta 中的 activeX 组件
我正在努力使用 .net activeX,我尝试在 ms axapta 2009 中使用。
在编译它的本地计算机上使用此组件,它工作得很好。 它可以作为 activeX 元素添加到表单上,方法和事件列在 axapta-activeX-explorer 中,我可以毫无问题地与它交互。
但尝试将 dll 分发给其他客户端并不能按预期工作。 通过 regasm /codebase /tlb 注册 dll 工作正常 - 收到消息,注册成功。 当选择要添加到 ax 中的 activeX 元素时,也会列出该组件,但既没有列出功能也没有列出属性。启动表单会导致错误消息 - activeX 组件 CLSID ...在系统上找不到,未安装。 classID 确实是.net 中定义的。
看看任务管理器,奇怪的事情发生了。 activeX 组件本身只是与 com 应用程序交互的包装器。当启动 ax-form 时,不工作并且_not_installed_!! activeX-thing,任务管理器显示了 com 应用程序的新进程,该进程由 activeX 实例化:/
我尝试过的东西:
- 使用不同版本的 regasm,例如 \Windows\Microsoft.NET\Framework\v2.0.50727 ; C:\Windows\Microsoft.NET\Framework64\v2.0.50727
- 在.net 中使用新的 GUID,事先从注册表
- 编译中删除旧的 GUID,使用不同版本的 .net 框架
- 通过 regasm、regasm /codebase、regasm / 进行注册代码库 /tlb,使用 Visual-studio-setup
- 通过命令行以管理员身份运行注册
- 以管理员身份运行安装程序
- 在客户端计算机上以管理员身份运行 ax
- 将 dll 移动到不同的文件夹,然后进行新注册( windows/system32; ax/client /bin )
- 安装到 GAC ( gacutil /i )
- Visual Studio 中的不同项目选项(COM-Visibility;注册 COM-Interop;不同的 targetPlatform )
希望在 Visual Studio 中启用注册 COM-Interop 选项进行编译所做的不仅仅是 regasm 注册,我还使用了registry-monitor-microsoft-tool 来记录编译期间发生的注册表活动。
使用这些日志在目标客户端上创建所有注册表项也不起作用。
任何提示或帮助将不胜感激! 这件事已经困扰我好几天了:(
i'm struggling with an .net activeX i try to use in ms axapta 2009.
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.
but trying to distribute the dll to other clients isn't working as intended.
the registration of the dll via regasm /codebase /tlb works properly - getting the message, registration was successful.
the component is also listed when selecting an activeX-element to add in ax, but neither functions nor properties are listed. and launching the form results in an errormessage - activeX component CLSID ... not found on system, not installed. the classID is indeed the one, defined in .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. when launching the ax-form with the not working and _not_installed_!! activeX-thing, the taskmanager shows a new process of the com-application, which is instanciated by the activeX :/
things i tried:
- using different versions of regasm, eg \Windows\Microsoft.NET\Framework\v2.0.50727 ;
C:\Windows\Microsoft.NET\Framework64\v2.0.50727 - using new GUIDs in .net, prior removing the old ones from the registry
- compiling, using different versions of the .net framework
- doing registration via regasm, regasm /codebase, regasm /codebase /tlb, using a visual-studio-setup
- running registration via command-line as administrator
- running setup as administrator
- running even ax as administrator on client-machine
- moving dll to a different folder followed by new registration ( windows/system32; ax/client/bin )
- installing to GAC ( gacutil /i )
- different project-options in visual studio ( COM-Visibility; register for COM-Interop; different 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.
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 :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有关 COM 集成的概述,请参见此处:
http://msdn.microsoft.com /en-us/library/aa591337.aspx
有关 .Net 集成的概述,请参见此处:
http://msdn.microsoft.com/en-us/library/aa659581.aspx
For an overview of COM integration look here:
http://msdn.microsoft.com/en-us/library/aa591337.aspx
For an overview of .Net integration look here:
http://msdn.microsoft.com/en-us/library/aa659581.aspx
我想要与之交互的“目标”应用程序是一个具有 COM 功能的独立 exe。
据我所知,AX 2009 不支持(或不会)支持 COM - 因此应该使用 .net。
如果我正确理解你的答案,这只是另一轮!
该 dll 只是作为访问上述应用程序的包装器。
regsvr32 不能与 dll 一起使用,因为必须使用 regasm 来注册。
我还在 AOT 中添加了引用 - 没有变化。
奇怪的是 - 它已经工作了,并且仍在我的本地开发系统上工作。但在其他系统上则不然。
the "target"-application, with which i want to interact is a stand-alone exe with COM-functionality.
as i know, COM isn't ( or will not be ) supported in AX 2009 - therefore .net should be used.
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.
regsvr32 don't work with the dll, since regasm must be used to register.
i've also added a reference in the AOT - no change.
curious thing is - it has already worked, and is still working on my local dev system. but not on other systems.
问题解决了。
一切都是正确的 - 唯一误导性的事情是启动添加了 activeX 组件的表单的错误消息,告诉“系统上找不到组件...”,
这是 activeX 代码中完全不同的错误:
解析其中包含特殊字符的 xml 文档并且未在 xml 文件中定义正确的 iso 编码会引发未捕获的错误。这(!!)导致了所有进一步的问题和最初的帖子中提到的崩溃错误:/
无论如何感谢您的帮助。
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..."
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. this(!!) caused all further problems and the crash-bug mentioned in the initial post :/
thanks anyway for help.