完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我正致力于将VEE用户功能集成到Visual Basic中,参考Microsoft Visual Studio 2008中的Callable AciveX Automation Server。我首先尝试使用非常简单的示例,我从Visual Basic代码调用它并且它工作正常。
但是当我在该示例中引入一些.NET代码时。 它在VEE Pro中运行良好。 但是,当我从visual basic调用它时,它失败了。 它给我错误说“ComException未处理”,无法访问.NET对象来执行操作。 VEE错误号:754在我调用该函数的行。 还有一个错误说“无法解析COM引用”36f6e2f6-a9ce-11d4-98e5-00108301cb39“版本1.0。类型库导入器在类型验证期间遇到错误。请尝试导入而不使用类成员。” VB代码如下:我附加了错误消息的快照,我在MS visual studio 2008中获得。公共类Form1 Dim服务器作为新的CallableVEE.CallServer Dim库作为CallableVEE.Library Dim calcUF作为CallableVEE.UserFunction Dim libfile As String Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load libfile =“C: SDA_VEE_Control Var_Calc.vee”server = CreateObject(“CallableVEE.CallServer”)library = server.Libraries。 Load(libfile)calcUF = library.UserFunctions(“Calc”)calcUF.Call()'----------------------------- Errored Line End SubEnd ClassI怀疑它与COM和.Net互操作性有关。 谁能告诉我如何解决这个问题或需要更多的信息。 提前致谢。 以上来自于谷歌翻译 以下为原文 Hi, I working on integration of VEE user function into Visual Basic taking reference of Callable AciveX Automation Server in Microsoft Visual Studio 2008. I first tried with very simple example and i called it from Visual basic code and it worked fine. But when i introduced some .NET code into that example. It works fine in VEE Pro. But when i called it from visual basic it failed. It gives me error saying "ComException was unhandled", cannot access .NET object to perform operations. VEE Error No: 754 at line where i am calling that function. One more error saying "Could not resolve COM reference "36f6e2f6-a9ce-11d4-98e5-00108301cb39" version 1.0. The type library importer encountered an error during type verification. Try importing without class members." VB code is as follow: I have attached snap shot of error message, which i got in MS visual studio 2008. Public Class Form1 Dim server As New CallableVEE.CallServer Dim library As CallableVEE.Library Dim calcUF As CallableVEE.UserFunction Dim libfile As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load libfile = "C:SDA_VEE_ControlVar_Calc.vee" server = CreateObject("CallableVEE.CallServer") library = server.Libraries.Load(libfile) calcUF = library.UserFunctions("Calc") calcUF.Call() '----------------------------- Errored Line End Sub End Class I suspect it has to do with COM and .Net interoperability. Can anyone tell me how to resolve this problem or require more infomation on it. Thanks in advance. |
|
相关推荐
6个回答
|
|
没有VEE代码,我的第一个猜测是关于VEE的变量初始化。无法解析COM引用声音,例如VEE试图调用尚未初始化的变量,或者以其他方式使用不正确。
以上来自于谷歌翻译 以下为原文 Not having the VEE code, my first guess is regarding VEE's initialization of variables. Could not resolve COM reference Sounds like VEE is trying to call a variable that hasn't been initialized, or is otherwise used improperly. |
|
|
|
你好,谢谢你的回复。
VEE代码(其中包含.Net)在VEE Pro 8.5中运行良好。 但是当我从Visual Basic调用它时它没有用。 我在MS Visual Studio 2008项目中引用了Callable AciveX Automation服务器和.Net程序集(在我的例子中是System.Windows.Forms)。 所以我认为变量的启动没有问题。 请告诉我如何附加VEE代码或doc文件? 以上来自于谷歌翻译 以下为原文 Hi, Thanks for your reply. VEE code (with .Net in it) worked fine in VEE Pro 8.5. But When I called it from Visual basic it didnt work. I have given reference of Callable AciveX Automation server and .Net assembly (in my case, System.Windows.Forms) in MS Visual Studio 2008 project. So I think there is no problem with initilization of variables. Please tell me how do i attach VEE code or doc file? |
|
|
|
“calcUF = library.UserFunctions(” 计算值 “)calcUF.Call()“-----------------------------差错线” 这
看起来你只需要调用一个用户功能。 我的意思是如果变量的初始化不在那个用户函数中。我有一个程序,它有一个完整的用户对象,只是为了初始化我需要的所有变量。 如果我试图在没有这些变量的情况下调用单个用户函数,它肯定会崩溃。要附加,当您键入响应时,“提交”按钮下面应该有一个“上载附件”选项卡。 要在文本中包含链接,应该有一个“内联”链接。 以上来自于谷歌翻译 以下为原文 " It looks like your only calling up one user function. What I meant was that if the initialization of variables was not in that user function. I have a program that has an entire user object just to initialize all the variables I will need. If I tried to call an individual user function without those variables, it would definitely crash. To attach, there should be an "Upload Attachment" tab just under the "Submit" button when you type your response. To include a link in your text, there should be an "inline" link. |
|
|
|
我认为问题是你的Calc函数有自己的显示c.f.
.NET控件,因此您需要在VB程序中提供一个区域才能显示。 反之亦然,即在VEE程序中进行.NET控制,您将控件放在某些类型的面板上,然后在程序运行时由.NET代码“绘制”。在第一个实例中,我会将您的测试更改为 调用纯粹处理数据的用户功能,例如 发送一个数字并读取结果。 要做到这一点,你当然需要传入参数 - 在C#中用对象数组完成 - 并读取响应。 以上来自于谷歌翻译 以下为原文 I think the problem is that your Calc function has it's own display in it c.f. .NET control and therefore you need to provide an area in your VB program for it to appear. In the other way round i.e. .NET control in a VEE program you place the control onto a panel of some sorts and that is then 'painted' by the .NET code when the program runs. In the first instance I would change your test to call a user function that purely deals with data e.g. send it a number and read the result. To do that of course you'll need to pass in the parameter(s) - in C# it is done with object arrays - and read the response. |
|
|
|
对不起老板,我没有明白你的观点。
你能举个例子吗? 以上来自于谷歌翻译 以下为原文 Sorry Boss, I didnt get your point. Can u please give me example of it? |
|
|
|
基本上,当你打电话给你的“计算器”时,VB正在努力将那个漂亮的小面板放在某个地方。
在你给它一个之前,它永远不会为它找到一个好地方。他不是要解决这个复杂的问题,而是建议删除面板(右键单击标题栏)并使程序在没有它的情况下正常运行。我希望我能正确理解 让你滚动,直到迈克尔回来更好地解释它。很奇怪,我会检查他的网站上的一些很棒的例子(在他的个人资料中列出)。 这对我帮助很大。 以上来自于谷歌翻译 以下为原文 Basically, when you call your "Calc" VB is trying really hard to put that nice little panel somewhere. It's never going to find a good place for it until you give it one. Instead of tackling that complicated problem, he suggests deleting the panel (right click on the title bar) and making the program functional without it. I hope I understood that correctly to get you rolling until Michael gets back to explain it better. Seriously, I would check his website for some awesome examples (listed in his profile). It helped me a LOT. |
|
|
|
只有小组成员才能发言,加入小组>>
1179 浏览 0 评论
2329 浏览 1 评论
2128 浏览 1 评论
1998 浏览 5 评论
2874 浏览 3 评论
908浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
676浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
772浏览 0评论
1181浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-3 05:04 , Processed in 1.588137 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号