ObjPtr从VB6在C#中当量(功能)? [英] Equivalent (functionality) of ObjPtr from VB6 in C#?

查看:135
本文介绍了ObjPtr从VB6在C#中当量(功能)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何人知道,如果C#有ObjPtr从VB6等同或等效功能(见下文的详细信息)?这里有几个环节信息的ObjPtr devx ,的 thevbzone

Does any one know if C# has an equivalent of ObjPtr from VB6, or equivalent functionality (see more info below)? Here are a couple of links to info on ObjPtr devx , thevbzone.

基本上,我有我需要走通获得特定的节点,但唯一的(相关)信息的节点已经是名第三方树状......但节点名不必是唯一的。所以,我需要为我走通它的第一次,所以当我走通了一遍,我知道这是要获得一个独特的价值为每个节点。在老同学VB6的日子里,我会用ObjPtr。

Basically I have a third party treeview that I need to walk thru to get specific nodes but the only (relevant) info the nodes have is name ... but the node names don't need to be unique. So I need to get a unique value for each node as I walk thru it the first time so when I walk thru it again I know which is which. In the old school VB6 days I would use ObjPtr.

任何想法或建议?

FK

推荐答案

如果他们的对象,为什么不直接存储对象引用?这些都将是独一无二的。

If they're objects, why not just store the object references directly? These will be unique.

您可以使用 Object.ReferenceEquals(X,Y)来确定是否已经存储的参考是指你刚刚从树上获取相同的对象。

You can use Object.ReferenceEquals(x, y) to determine if a reference you have stored is referring to the same object you just retrieved from the tree.

这篇关于ObjPtr从VB6在C#中当量(功能)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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