什么是VB.Net和VB6中的ObjectContext对象 [英] What is ObjectContext Object in VB.Net and VB6

查看:65
本文介绍了什么是VB.Net和VB6中的ObjectContext对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VB.Net VB6 中的 ObjectContext对象是什么。

什么是 GetObjectContext 用于的函数。

有人可以提供其使用的任何具体示例。





我问这个问题的原因是我正在将用VB6编写的COM对象转换为VB.Net。

有一些使用 ObjectContext 的代码没有任何意义。



这是代码..



//////////////////////////// ///////////////

What is ObjectContext Object in VB.Net or VB6.
What is GetObjectContext function used for.
Can someone provide any concrete example of its use.


The reason I am asking this question is that I am in the process of converting a COM object written in VB6 to VB.Net.
There was some code using ObjectContext which did not make any sense.

Here is the code..

///////////////////////////////////////////

Dim objvar As String

Set objCtx = GetObjectContext()

objvar = "HRA.NQAGGR"

Set objscrid = CreateObject(objvar)

funcnretval = CallByName(objscrid, screenID, VbMethod, uparray, downarray, tpcode)

If Not objCtx Is Nothing Then
  objCtx.SetComplete
End If



///////////////////////// ///////////////



正如您在代码中看到的那样,创建了objectcontext,然后创建了SetComplete而没有实际使用。它没有任何意义。我想知道是否可以在COM对象的新Vb.Net转换中忽略此代码。


////////////////////////////////////////

As you can see in the code, the objectcontext is created and then SetComplete without actually being used. It does not make sense. I was wondering whether I could just ignore this code in the new Vb.Net conversion of the COM object.

推荐答案

我发现对此stackoverflow post [ ^ ]特别有用 - 尤其是来自PatFromCanada的那个。



关于你是否可以在新版本中忽略它,这取决于你如何进行转换



查看这些可能有用的其他资源

http:// msdn .microsoft.com / zh-cn / library / system.data.objects.objectcontext(v = vs.110).aspx [ ^ ]





https://support.microsoft.com/kb/238274 [ ^ ]
I found the responses to this stackoverflow post[^] particularly useful - especially the one from PatFromCanada.

As to whether you can ignore it in the new version that depends on how you are going about your conversion

See these other resources which may help
http://msdn.microsoft.com/en-us/library/system.data.objects.objectcontext(v=vs.110).aspx[^]

and
https://support.microsoft.com/kb/238274[^]


这篇关于什么是VB.Net和VB6中的ObjectContext对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆