开发者

Why do equal strings sometimes behave differently? (VB.NET COM interface)

Example:

Dim Sh32 As Object = CreateObject("Shell.Application")
Dim path As String = "C:\temp\catalog.zip"
Dim sf As Object = Sh32.NameSpace(path)

-> does not work, sf = Nothing

Dim Sh32 As Object = CreateObject("Shell.Application")
Dim path As String = "C:\temp\catalog.zip"
Dim sf As Object = Sh32.NameSpace(path.T开发者_开发技巧oString)

-> works

Any idea?

Clearly path = path.ToString, but they behave differently when used as COM parameters.


Hmm, I don't know the details of VB and/or COM well enough, but maybe there is a difference between a string object and a string representation?

Should be interesting to see someone "in the know" resolving the puzzle ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜